Skip to content

v0.2.5

Compare
Choose a tag to compare
@github-actions github-actions released this 01 Jul 17:00
· 36 commits to main since this release
7b5815e

Changelog

v0.2.5 (2024-07-01)

Browse the Repository | Released Assets

Changes

  • Validate possible keyword arguments for functions that accept named arguments.

    iex> img = Evision.imread("test/testdata/dog.jpg")
    
    # valid keyword argument
    iex> Evision.applyColorMap(src: img, colormap: Evision.Constant.cv_COLORMAP_AUTUMN)
    %Evision.Mat{
      channels: 3,
      dims: 2,
      type: {:u, 8},
      raw_type: 16,
      shape: {576, 768, 3},
      ref: #Reference<0.97833242.1116078104.245977>
    }
    
    # list all possible keyword arguments if the user provides any invalid ones
    iex> Evision.applyColorMap(src: img, colorMap: Evision.Constant.cv_COLORMAP_AUTUMN)
    ** (ArgumentError) unknown keys [:colorMap] in [src: %Evision.Mat{channels: 3, dims: 2, type: {:u, 8}, raw_type: 16, shape: {576, 768, 3}, ref: #Reference<0.97833242.1116078110.246705>}, colorMap: 0], the allowed keys are: [:dst, :colormap, :userColor, :src]
        (elixir 1.18.0-dev) lib/keyword.ex:362: Keyword.validate!/2
        (evision 0.2.4) lib/generated/evision.ex:4603: Evision.applyColorMap/1
        iex:4: (file)
  • Generated typed enums for OpenCV's cv::flann.

  • This should include the following enums and place them in the corresponding modules.

    • flann_algorithm_t
    • flann_centers_init_t
    • flann_log_level_t
    • flann_distance_t
    • flann_datatype_t

    For example, flann_algorithm_t will be put in the Evision.Flann.Algorithm module:

    defmodule Evision.Flann.Algorithm do
      @type enum :: integer()
      @doc enum: true
      def cv_FLANN_INDEX_LINEAR, do: 0
      @doc enum: true
      def cv_FLANN_INDEX_KDTREE, do: 1
      @doc enum: true
      def cv_FLANN_INDEX_KMEANS, do: 2
      @doc enum: true
      def cv_FLANN_INDEX_COMPOSITE, do: 3
      @doc enum: true
      def cv_FLANN_INDEX_KDTREE_SINGLE, do: 4
      @doc enum: true
      def cv_FLANN_INDEX_HIERARCHICAL, do: 5
      @doc enum: true
      def cv_FLANN_INDEX_LSH, do: 6
      @doc enum: true
      def cv_FLANN_INDEX_SAVED, do: 254
      @doc enum: true
      def cv_FLANN_INDEX_AUTOTUNED, do: 255
    end