mcc2_c_helper 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 46739fd4d15f129655881fe657c18c7b7d92e726c8613e8954b473254fd48550
4
+ data.tar.gz: 2b5e881c5956d27c92ea7685ac2b89d1e45b6d14b7e74dc7b840e0ac1c8bcfc7
5
+ SHA512:
6
+ metadata.gz: be5e1c2ddd8978fca20680aaefde7b82ae0ae003557a86e027f8b04038f9c275854bac31c99602c986fde5946bf84257dd5e53603642b207e9234ba744b1967d
7
+ data.tar.gz: 02c694db34e6b319417604c1eb4f86a7ee8bb5f4d14d7c3d8d1bfbfdbb73e2df0fb271245344b210d99b82238cc13fb572bf4788e639b7e7f885c958fadf8b8b
checksums.yaml.gz.sig ADDED
Binary file
@@ -0,0 +1,31 @@
1
+ name: Ruby CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ name: Test on ${{ matrix.os }} (Ruby ${{ matrix.ruby }})
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ os: [ubuntu-latest, windows-latest]
16
+ ruby: ['3.2', '4.0']
17
+
18
+ runs-on: ${{ matrix.os }}
19
+
20
+ steps:
21
+ - name: Checkout code
22
+ uses: actions/checkout@v4
23
+
24
+ - name: Set up Ruby
25
+ uses: ruby/setup-ruby@v1
26
+ with:
27
+ ruby-version: ${{ matrix.ruby }}
28
+ bundler-cache: true
29
+
30
+ - name: Run tests
31
+ run: bundle exec rake compile test TESTOPT=-v
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,23 @@
1
+ .job_template: &job_definition
2
+ variables:
3
+ MAKE: make -j6
4
+
5
+ script:
6
+ - bundle install
7
+ - bundle exec rake compile test TESTOPTS=-v
8
+
9
+ test-3.0:
10
+ <<: *job_definition
11
+ image: comcard/ruby:3.0
12
+
13
+ test-latest:
14
+ <<: *job_definition
15
+ image: comcard/ruby:latest
16
+
17
+ test-windows-latest:
18
+ <<: *job_definition
19
+ image: comcard/ruby:latest
20
+ tags:
21
+ - windows
22
+ before_script:
23
+ - ridk enable
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Lars Kanis
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # Mcc2CHelper
2
+
3
+ Some helper functions for fast image data processing. Used by mcc2 gem.
4
+
5
+ ## Installation
6
+
7
+ Install the gem and add to the application's Gemfile by executing:
8
+
9
+ ```bash
10
+ bundle add mcc2_c_helper
11
+ ```
12
+
13
+ If bundler is not being used to manage dependencies, install the gem by executing:
14
+
15
+ ```bash
16
+ gem install mcc2_c_helper
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Development
24
+
25
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
+
27
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
+
29
+ ## Contributing
30
+
31
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/mcc2_c_helper.
32
+
33
+ ## License
34
+
35
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "minitest/test_task"
5
+
6
+ Minitest::TestTask.create
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ require "rake/extensiontask"
13
+
14
+ task build: :compile
15
+
16
+ GEMSPEC = Gem::Specification.load("mcc2_c_helper.gemspec")
17
+
18
+ Rake::ExtensionTask.new("mcc2_c_helper", GEMSPEC) do |ext|
19
+ ext.lib_dir = "lib/mcc2_c_helper"
20
+ end
21
+
22
+ task default: %i[clobber compile test rubocop]
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "mkmf"
4
+
5
+ # Makes all symbols private by default to avoid unintended conflict
6
+ # with other gems. To explicitly export symbols you can use RUBY_FUNC_EXPORTED
7
+ # selectively, or entirely remove this flag.
8
+ append_cflags("-fvisibility=hidden")
9
+
10
+ create_makefile("mcc2_c_helper/mcc2_c_helper")
@@ -0,0 +1,34 @@
1
+ #include "mcc2_c_helper.h"
2
+
3
+ VALUE rb_mMcc2CHelper;
4
+
5
+ static VALUE bgra_to_bgr(VALUE self, VALUE instr)
6
+ {
7
+ char *src = StringValuePtr(instr);
8
+ long inlen = RSTRING_LEN(instr);
9
+ char *dst;
10
+ VALUE outstr;
11
+
12
+ outstr = rb_str_new2("");
13
+ rb_str_resize(outstr, inlen / 4 * 3);
14
+ dst = RSTRING_PTR(outstr);
15
+
16
+ for (int i = 0; i < inlen-3; i+=4) {
17
+ unsigned char b = src[i + 0];
18
+ unsigned char g = src[i + 1];
19
+ unsigned char r = src[i + 2];
20
+ dst[0] = b;
21
+ dst[1] = g;
22
+ dst[2] = r;
23
+ dst += 3;
24
+ }
25
+ return outstr;
26
+ }
27
+
28
+
29
+ RUBY_FUNC_EXPORTED void
30
+ Init_mcc2_c_helper(void)
31
+ {
32
+ rb_mMcc2CHelper = rb_define_module("Mcc2CHelper");
33
+ rb_define_singleton_method(rb_mMcc2CHelper, "bgra_to_bgr", bgra_to_bgr, 1);
34
+ }
@@ -0,0 +1,6 @@
1
+ #ifndef MCC2_C_HELPER_H
2
+ #define MCC2_C_HELPER_H 1
3
+
4
+ #include "ruby.h"
5
+
6
+ #endif /* MCC2_C_HELPER_H */
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mcc2CHelper
4
+ VERSION = "0.1.2"
5
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "mcc2_c_helper/version"
4
+ require "mcc2_c_helper/mcc2_c_helper"
5
+
6
+ module Mcc2CHelper
7
+ class Error < StandardError; end
8
+ # Your code goes here...
9
+ end
@@ -0,0 +1,4 @@
1
+ module Mcc2CHelper
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
data.tar.gz.sig ADDED
Binary file
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mcc2_c_helper
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Lars Kanis
8
+ bindir: exe
9
+ cert_chain:
10
+ - |
11
+ -----BEGIN CERTIFICATE-----
12
+ MIIEBDCCAmygAwIBAgIBBDANBgkqhkiG9w0BAQ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
28
+ OoLQHxjhhqhKBoP4lHXg/OMK9dnGn8+5DoKcsyWQvqq/GdK8pi4E47M/egzw54Go
29
+ g+oeyGDsNKOQlnIA9gbyPpExD1+akJ4v88T8jOUnsOkhBBUkpSktC2QmEYIU5e9j
30
+ N7muw6O5Bz3CQuSWIEjj9mMUS2fEEfq2km6zO5vs5eD6TdFnt8AC/HlOrPaxGcUX
31
+ Hjw/K7ZTvZLEb4awRijdy4wx3OlL9FAyZPjYOh8TdJrLl076c7GyimAkgnc8BrL5
32
+ g1vGc759o2t3KNnlUg8VwqkhFJp4gCko1QO/8Io5hPQZOvJw8dmqNiiiHqaDupfl
33
+ CI4mk2K8yQa8xtQ/RmFZxYS5XbHhDJCw
34
+ -----END CERTIFICATE-----
35
+ date: 1980-01-02 00:00:00.000000000 Z
36
+ dependencies: []
37
+ description: Some helper functions for fast image data processing.
38
+ email:
39
+ - lars.kanis@sincnovation.com
40
+ executables: []
41
+ extensions:
42
+ - ext/mcc2_c_helper/extconf.rb
43
+ extra_rdoc_files: []
44
+ files:
45
+ - ".github/workflow/ci.yml"
46
+ - ".gitlab-ci.yml"
47
+ - LICENSE.txt
48
+ - README.md
49
+ - Rakefile
50
+ - ext/mcc2_c_helper/extconf.rb
51
+ - ext/mcc2_c_helper/mcc2_c_helper.c
52
+ - ext/mcc2_c_helper/mcc2_c_helper.h
53
+ - lib/mcc2_c_helper.rb
54
+ - lib/mcc2_c_helper/version.rb
55
+ - sig/mcc2_c_helper.rbs
56
+ homepage: https://github.com/larskanis/mcc2_c_helper
57
+ licenses:
58
+ - MIT
59
+ metadata: {}
60
+ rdoc_options: []
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '2.4'
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ requirements: []
74
+ rubygems_version: 4.0.16
75
+ specification_version: 4
76
+ summary: Some helper functions for fast image data processing
77
+ test_files: []
metadata.gz.sig ADDED
@@ -0,0 +1,4 @@
1
+ [J�:�i�I� w^�5�>G�p}���O'e��z�LuR#]�:�vkx؊�
2
+ �g?M8Y,"�c�r�I��B�����=�樳ma��~Ǜf�m����*�%;V�oH���_�Nq)QgR2�0�_���{�>iC$#��ˠ,����/�[b ��%6��l�;D���W;3��z��m#��N���
3
+ )�{��g�%6 �
4
+ ���ƕKP�3(Uz3��D��[9ȸW�ȿm�f��n�<����|�&�K�|:%�I[�7�fx[���gsDډV� �9З��4t�|w����n8��~���v�
- ��