bitmap-plus-plus 1.0.0
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 +7 -0
- data/CHANGELOG.md +40 -0
- data/LICENSE +25 -0
- data/README.md +75 -0
- data/examples/colormaps.rb +1857 -0
- data/examples/draw_primitives.rb +53 -0
- data/examples/julia.rb +68 -0
- data/examples/mandelbrot.rb +68 -0
- data/examples/random_colors.rb +37 -0
- data/examples/transformations.rb +84 -0
- data/ext/BitmapPlusPlus-rb.cpp +420 -0
- data/ext/BitmapPlusPlus-rb.hpp +11 -0
- data/ext/BitmapPlusPlus.hpp +659 -0
- data/ext/CMakeLists.txt +170 -0
- data/ext/CMakePresets.json +209 -0
- data/lib/bitmap-plus-plus/version.rb +3 -0
- data/lib/bitmap-plus-plus.rb +3 -0
- data/sig/Bmp/Bitmap.rbs +39 -0
- data/sig/Bmp/BitmapHeader.rbs +22 -0
- data/sig/Bmp/Exception.rbs +5 -0
- data/sig/Bmp/Pixel.rbs +16 -0
- data/sig/Rice/Arg.rbs +6 -0
- data/sig/Rice/Buffer/342/211/272Rice/352/236/211/352/236/211detail/352/236/211/352/236/211ParameterAbstract/342/210/227/342/211/273.rbs +15 -0
- data/sig/Rice/Buffer/342/211/272char/342/211/273.rbs +16 -0
- data/sig/Rice/ModuleRegistry.rbs +5 -0
- data/sig/Rice/Native.rbs +9 -0
- data/sig/Rice/NativeKind.rbs +20 -0
- data/sig/Rice/NativeRegistry.rbs +5 -0
- data/sig/Rice/Parameter.rbs +7 -0
- data/sig/Rice/Pointer/342/211/272Rice/352/236/211/352/236/211detail/352/236/211/352/236/211ParameterAbstract/342/210/227/342/211/273.rbs +5 -0
- data/sig/Rice/Pointer/342/211/272char/342/211/273.rbs +5 -0
- data/sig/Rice/Reference/342/211/272char/342/211/273.rbs +6 -0
- data/sig/Rice/Reference/342/211/272int/342/211/273.rbs +6 -0
- data/sig/Rice/Reference/342/211/272unsigned/302/240Int64/342/211/273.rbs +6 -0
- data/sig/Rice/Registries.rbs +8 -0
- data/sig/Rice/TypeRegistry.rbs +5 -0
- data/sig/Std/Exception.rbs +6 -0
- data/sig/Std/Filesystem/Path.rbs +6 -0
- data/sig/Std/RuntimeError.rbs +6 -0
- data/sig/Std/Vector/342/211/272Rice/352/236/211/352/236/211detail/352/236/211/352/236/211ParameterAbstract/302/240const/342/210/227/342/211/273.rbs +33 -0
- metadata +116 -0
data/ext/CMakeLists.txt
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# CMakeLists.txt - Building a Ruby Extension with Rice
|
|
3
|
+
# =============================================================================
|
|
4
|
+
#
|
|
5
|
+
# This CMake configuration demonstrates how to build a Ruby native extension
|
|
6
|
+
# using the Rice library (https://github.com/ruby-rice/rice). Rice provides
|
|
7
|
+
# a clean C++ interface for creating Ruby bindings.
|
|
8
|
+
#
|
|
9
|
+
# This file serves as an educational example and can be adapted for your
|
|
10
|
+
# own Rice-based Ruby extensions.
|
|
11
|
+
#
|
|
12
|
+
# =============================================================================
|
|
13
|
+
|
|
14
|
+
# -----------------------------------------------------------------------------
|
|
15
|
+
# CMake Version and C++ Standard
|
|
16
|
+
# -----------------------------------------------------------------------------
|
|
17
|
+
# CMake 3.26+ is required for modern FetchContent features and improved
|
|
18
|
+
# Ruby detection. Rice requires C++17 for features like std::string_view,
|
|
19
|
+
# structured bindings, and if-constexpr.
|
|
20
|
+
|
|
21
|
+
cmake_minimum_required(VERSION 3.26)
|
|
22
|
+
|
|
23
|
+
set(CMAKE_CXX_STANDARD 17)
|
|
24
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
25
|
+
|
|
26
|
+
# -----------------------------------------------------------------------------
|
|
27
|
+
# Project Definition
|
|
28
|
+
# -----------------------------------------------------------------------------
|
|
29
|
+
# Define the project name and specify that we only need a C++ compiler.
|
|
30
|
+
# The project name is used throughout via ${CMAKE_PROJECT_NAME}.
|
|
31
|
+
|
|
32
|
+
project(BitmapPlusPlus LANGUAGES CXX)
|
|
33
|
+
|
|
34
|
+
# -----------------------------------------------------------------------------
|
|
35
|
+
# Create the Extension Library
|
|
36
|
+
# -----------------------------------------------------------------------------
|
|
37
|
+
# IMPORTANT: Use MODULE instead of SHARED for Ruby extensions!
|
|
38
|
+
#
|
|
39
|
+
# - MODULE: Creates a loadable plugin that cannot be linked against.
|
|
40
|
+
# This is correct for Ruby extensions loaded via require/dlopen.
|
|
41
|
+
# - SHARED: Creates a shared library that can be linked against.
|
|
42
|
+
# On macOS, this creates a .dylib which Ruby cannot load.
|
|
43
|
+
|
|
44
|
+
add_library(${CMAKE_PROJECT_NAME} MODULE)
|
|
45
|
+
|
|
46
|
+
# -----------------------------------------------------------------------------
|
|
47
|
+
# Fetch Rice from GitHub
|
|
48
|
+
# -----------------------------------------------------------------------------
|
|
49
|
+
# Rice is a header-only library, so we use FetchContent to download it
|
|
50
|
+
# automatically. This eliminates the need for users to manually install Rice.
|
|
51
|
+
#
|
|
52
|
+
# FetchContent downloads the repository at configure time and makes it
|
|
53
|
+
# available as if it were part of your project.
|
|
54
|
+
#
|
|
55
|
+
# Note: For production gems, you may want to pin to a specific release tag
|
|
56
|
+
# instead of 'dev' for reproducible builds.
|
|
57
|
+
|
|
58
|
+
include(FetchContent)
|
|
59
|
+
FetchContent_Declare(
|
|
60
|
+
rice
|
|
61
|
+
GIT_REPOSITORY https://github.com/ruby-rice/rice.git
|
|
62
|
+
GIT_TAG 4.8.0
|
|
63
|
+
)
|
|
64
|
+
FetchContent_MakeAvailable(rice)
|
|
65
|
+
|
|
66
|
+
# -----------------------------------------------------------------------------
|
|
67
|
+
# Configure Ruby Detection
|
|
68
|
+
# -----------------------------------------------------------------------------
|
|
69
|
+
# Rice provides an enhanced FindRuby.cmake that creates proper CMake targets
|
|
70
|
+
# (Ruby::Ruby, Ruby::Module) instead of just setting variables. We prepend
|
|
71
|
+
# Rice's module path so CMake finds this improved version.
|
|
72
|
+
#
|
|
73
|
+
# The upstream CMake FindRuby.cmake is being updated to support these targets,
|
|
74
|
+
# but until that lands, we use Rice's version.
|
|
75
|
+
|
|
76
|
+
list(PREPEND CMAKE_MODULE_PATH "${rice_SOURCE_DIR}")
|
|
77
|
+
|
|
78
|
+
# -----------------------------------------------------------------------------
|
|
79
|
+
# Find Ruby Installation
|
|
80
|
+
# -----------------------------------------------------------------------------
|
|
81
|
+
# find_package(Ruby) locates the Ruby installation and sets up:
|
|
82
|
+
# - Ruby::Ruby - Target for embedding Ruby (links to libruby)
|
|
83
|
+
# - Ruby::Module - Target for extensions (links to Ruby headers only)
|
|
84
|
+
#
|
|
85
|
+
# For extensions, always link to Ruby::Module, not Ruby::Ruby!
|
|
86
|
+
# Extensions are loaded into an already-running Ruby process, so they
|
|
87
|
+
# should not link against libruby (which could cause symbol conflicts).
|
|
88
|
+
|
|
89
|
+
find_package(Ruby REQUIRED)
|
|
90
|
+
|
|
91
|
+
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE
|
|
92
|
+
Ruby::Module
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
# -----------------------------------------------------------------------------
|
|
96
|
+
# Link to Rice
|
|
97
|
+
# -----------------------------------------------------------------------------
|
|
98
|
+
# The Rice::Rice target provides:
|
|
99
|
+
# - Include paths to Rice headers
|
|
100
|
+
# - Required compiler flags for Rice
|
|
101
|
+
#
|
|
102
|
+
# Rice is header-only, so this doesn't add any link-time dependencies.
|
|
103
|
+
|
|
104
|
+
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE
|
|
105
|
+
Rice::Rice
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
# -----------------------------------------------------------------------------
|
|
109
|
+
# Include Directories for Project Headers
|
|
110
|
+
# -----------------------------------------------------------------------------
|
|
111
|
+
# Add the current directory (ext/) to the include path so we can find
|
|
112
|
+
# our project's header files (BitmapPlusPlus.hpp, etc.)
|
|
113
|
+
|
|
114
|
+
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE .)
|
|
115
|
+
|
|
116
|
+
# -----------------------------------------------------------------------------
|
|
117
|
+
# Configure Extension Output
|
|
118
|
+
# -----------------------------------------------------------------------------
|
|
119
|
+
# Ruby extensions have specific naming requirements that vary by platform:
|
|
120
|
+
#
|
|
121
|
+
# Extension Suffix (from Ruby configuration):
|
|
122
|
+
# - Linux: .so (e.g., bitmap_plus_plus_ruby.so)
|
|
123
|
+
# - macOS: .bundle (e.g., bitmap_plus_plus_ruby.bundle)
|
|
124
|
+
# - Windows: .so (e.g., bitmap_plus_plus_ruby.so)
|
|
125
|
+
#
|
|
126
|
+
# Note: Windows uses .so (not .dll) for Ruby extensions by convention.
|
|
127
|
+
#
|
|
128
|
+
# PREFIX "": Ruby extensions have no 'lib' prefix (unlike regular shared libs)
|
|
129
|
+
#
|
|
130
|
+
# Visibility Settings:
|
|
131
|
+
# - CXX_VISIBILITY_PRESET hidden: Hide all symbols by default
|
|
132
|
+
# - VISIBILITY_INLINES_HIDDEN ON: Hide inline function symbols
|
|
133
|
+
# - WINDOWS_EXPORT_ALL_SYMBOLS OFF: Don't auto-export on Windows
|
|
134
|
+
#
|
|
135
|
+
# These settings ensure only the Init_* function is exported, reducing
|
|
136
|
+
# binary size and avoiding symbol conflicts with other extensions.
|
|
137
|
+
#
|
|
138
|
+
# Output Directories:
|
|
139
|
+
# - RUNTIME_OUTPUT_DIRECTORY: Where Windows puts .dll/.so files
|
|
140
|
+
# - LIBRARY_OUTPUT_DIRECTORY: Where Unix puts .so/.bundle files
|
|
141
|
+
#
|
|
142
|
+
# On Windows, we place the extension in a Ruby version-specific subdirectory
|
|
143
|
+
# (e.g., lib/3.3/) to support multiple Ruby versions simultaneously.
|
|
144
|
+
|
|
145
|
+
get_target_property(RUBY_EXT_SUFFIX Ruby::Ruby INTERFACE_RUBY_EXTENSION_SUFFIX)
|
|
146
|
+
|
|
147
|
+
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
|
|
148
|
+
PREFIX ""
|
|
149
|
+
SUFFIX "${RUBY_EXT_SUFFIX}"
|
|
150
|
+
OUTPUT_NAME "bitmap_plus_plus_ruby"
|
|
151
|
+
CXX_VISIBILITY_PRESET hidden
|
|
152
|
+
VISIBILITY_INLINES_HIDDEN ON
|
|
153
|
+
WINDOWS_EXPORT_ALL_SYMBOLS OFF
|
|
154
|
+
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/../lib"
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
# -----------------------------------------------------------------------------
|
|
158
|
+
# Source Files
|
|
159
|
+
# -----------------------------------------------------------------------------
|
|
160
|
+
# List all source files for the extension. The naming convention used here is:
|
|
161
|
+
# - ProjectName-rb.hpp: Header declaring the Init function
|
|
162
|
+
# - ProjectName-rb.cpp: Implementation with Rice bindings
|
|
163
|
+
#
|
|
164
|
+
# The Init_<name> function in the .cpp file is the entry point Ruby calls
|
|
165
|
+
# when the extension is loaded via 'require'.
|
|
166
|
+
|
|
167
|
+
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
|
|
168
|
+
"${CMAKE_PROJECT_NAME}-rb.hpp"
|
|
169
|
+
"${CMAKE_PROJECT_NAME}-rb.cpp"
|
|
170
|
+
)
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 6,
|
|
3
|
+
"configurePresets": [
|
|
4
|
+
{
|
|
5
|
+
"name": "base",
|
|
6
|
+
"hidden": true,
|
|
7
|
+
"generator": "Ninja",
|
|
8
|
+
"binaryDir": "${sourceDir}/build/${presetName}",
|
|
9
|
+
"installDir": "${sourceDir}/install/${presetName}",
|
|
10
|
+
"cacheVariables": {
|
|
11
|
+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "linux-debug",
|
|
16
|
+
"inherits": "base",
|
|
17
|
+
"displayName": "Linux Debug",
|
|
18
|
+
"cacheVariables": {
|
|
19
|
+
"CMAKE_BUILD_TYPE": "Debug",
|
|
20
|
+
"CMAKE_CXX_FLAGS": "-Wall -ftemplate-backtrace-limit=0 -Og"
|
|
21
|
+
},
|
|
22
|
+
"condition": {
|
|
23
|
+
"type": "equals",
|
|
24
|
+
"lhs": "${hostSystemName}",
|
|
25
|
+
"rhs": "Linux"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "linux-release",
|
|
30
|
+
"inherits": "base",
|
|
31
|
+
"displayName": "Linux Release",
|
|
32
|
+
"cacheVariables": {
|
|
33
|
+
"CMAKE_BUILD_TYPE": "Release",
|
|
34
|
+
"CMAKE_CXX_FLAGS": "-Wall -ftemplate-backtrace-limit=0 -O3 -DNDEBUG"
|
|
35
|
+
},
|
|
36
|
+
"condition": {
|
|
37
|
+
"type": "equals",
|
|
38
|
+
"lhs": "${hostSystemName}",
|
|
39
|
+
"rhs": "Linux"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "macos-debug",
|
|
44
|
+
"inherits": "base",
|
|
45
|
+
"displayName": "macOS Debug",
|
|
46
|
+
"cacheVariables": {
|
|
47
|
+
"CMAKE_BUILD_TYPE": "Debug",
|
|
48
|
+
"CMAKE_CXX_FLAGS": "-Wall -Wno-unused-private-field -ftemplate-backtrace-limit=0 -Og"
|
|
49
|
+
},
|
|
50
|
+
"condition": {
|
|
51
|
+
"type": "equals",
|
|
52
|
+
"lhs": "${hostSystemName}",
|
|
53
|
+
"rhs": "Darwin"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "macos-release",
|
|
58
|
+
"inherits": "base",
|
|
59
|
+
"displayName": "macOS Release",
|
|
60
|
+
"cacheVariables": {
|
|
61
|
+
"CMAKE_BUILD_TYPE": "Release",
|
|
62
|
+
"CMAKE_CXX_FLAGS": "-Wall -Wno-unused-private-field -ftemplate-backtrace-limit=0 -O3 -DNDEBUG"
|
|
63
|
+
},
|
|
64
|
+
"condition": {
|
|
65
|
+
"type": "equals",
|
|
66
|
+
"lhs": "${hostSystemName}",
|
|
67
|
+
"rhs": "Darwin"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "windows",
|
|
72
|
+
"hidden": true,
|
|
73
|
+
"inherits": "base",
|
|
74
|
+
"condition": {
|
|
75
|
+
"type": "equals",
|
|
76
|
+
"lhs": "${hostSystemName}",
|
|
77
|
+
"rhs": "Windows"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "msvc-debug",
|
|
82
|
+
"inherits": "windows",
|
|
83
|
+
"displayName": "MSVC x64 Debug",
|
|
84
|
+
"cacheVariables": {
|
|
85
|
+
"CMAKE_BUILD_TYPE": "Debug",
|
|
86
|
+
"CMAKE_CXX_COMPILER": "cl.exe",
|
|
87
|
+
"CMAKE_CXX_FLAGS": "/EHs /W4 /bigobj /utf-8 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE",
|
|
88
|
+
"CMAKE_MSVC_DEBUG_INFORMATION_FORMAT": "EditAndContinue"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "msvc-release",
|
|
93
|
+
"inherits": "windows",
|
|
94
|
+
"displayName": "MSVC x64 Release",
|
|
95
|
+
"cacheVariables": {
|
|
96
|
+
"CMAKE_BUILD_TYPE": "Release",
|
|
97
|
+
"CMAKE_CXX_COMPILER": "cl.exe",
|
|
98
|
+
"CMAKE_CXX_FLAGS": "/EHs /W4 /bigobj /utf-8 /O2 /DNDEBUG /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE",
|
|
99
|
+
"CMAKE_MSVC_DEBUG_INFORMATION_FORMAT": "ProgramDatabase"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "clang-windows-debug",
|
|
104
|
+
"inherits": "windows",
|
|
105
|
+
"displayName": "Clang Windows Debug",
|
|
106
|
+
"cacheVariables": {
|
|
107
|
+
"CMAKE_BUILD_TYPE": "Debug",
|
|
108
|
+
"CMAKE_CXX_COMPILER": "clang-cl.exe",
|
|
109
|
+
"CMAKE_CXX_FLAGS": "/EHs /W4 /bigobj /utf-8 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /clang:-Wno-unused-private-field"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"name": "clang-windows-release",
|
|
114
|
+
"inherits": "windows",
|
|
115
|
+
"displayName": "Clang Windows Release",
|
|
116
|
+
"cacheVariables": {
|
|
117
|
+
"CMAKE_BUILD_TYPE": "Release",
|
|
118
|
+
"CMAKE_CXX_COMPILER": "clang-cl.exe",
|
|
119
|
+
"CMAKE_CXX_FLAGS": "/EHs /W4 /bigobj /utf-8 /O2 /DNDEBUG /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /clang:-Wno-unused-private-field"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "mingw-debug",
|
|
124
|
+
"inherits": "base",
|
|
125
|
+
"displayName": "MinGW x64 Debug",
|
|
126
|
+
"cacheVariables": {
|
|
127
|
+
"CMAKE_BUILD_TYPE": "Debug",
|
|
128
|
+
"CMAKE_CXX_COMPILER": "g++.exe",
|
|
129
|
+
"CMAKE_CXX_FLAGS": "-Wall -ftemplate-backtrace-limit=0 -Wa,-mbig-obj -Og",
|
|
130
|
+
"CMAKE_EXE_LINKER_FLAGS": "-fuse-ld=lld",
|
|
131
|
+
"CMAKE_SHARED_LINKER_FLAGS": "-fuse-ld=lld"
|
|
132
|
+
},
|
|
133
|
+
"condition": {
|
|
134
|
+
"type": "equals",
|
|
135
|
+
"lhs": "${hostSystemName}",
|
|
136
|
+
"rhs": "Windows"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"name": "mingw-release",
|
|
141
|
+
"inherits": "base",
|
|
142
|
+
"displayName": "MinGW x64 Release",
|
|
143
|
+
"cacheVariables": {
|
|
144
|
+
"CMAKE_BUILD_TYPE": "Release",
|
|
145
|
+
"CMAKE_CXX_COMPILER": "g++.exe",
|
|
146
|
+
"CMAKE_CXX_FLAGS": "-Wall -ftemplate-backtrace-limit=0 -Wa,-mbig-obj -O3 -DNDEBUG",
|
|
147
|
+
"CMAKE_EXE_LINKER_FLAGS": "-fuse-ld=lld",
|
|
148
|
+
"CMAKE_SHARED_LINKER_FLAGS": "-fuse-ld=lld"
|
|
149
|
+
},
|
|
150
|
+
"condition": {
|
|
151
|
+
"type": "equals",
|
|
152
|
+
"lhs": "${hostSystemName}",
|
|
153
|
+
"rhs": "Windows"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"buildPresets": [
|
|
158
|
+
{
|
|
159
|
+
"name": "linux-debug",
|
|
160
|
+
"displayName": "Build Linux Debug",
|
|
161
|
+
"configurePreset": "linux-debug"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "linux-release",
|
|
165
|
+
"displayName": "Build Linux Release",
|
|
166
|
+
"configurePreset": "linux-release"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"name": "macos-debug",
|
|
170
|
+
"displayName": "Build macOS Debug",
|
|
171
|
+
"configurePreset": "macos-debug"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"name": "macos-release",
|
|
175
|
+
"displayName": "Build macOS Release",
|
|
176
|
+
"configurePreset": "macos-release"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"name": "msvc-debug",
|
|
180
|
+
"displayName": "Build MSVC x64 Debug",
|
|
181
|
+
"configurePreset": "msvc-debug"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"name": "msvc-release",
|
|
185
|
+
"displayName": "Build MSVC x64 Release",
|
|
186
|
+
"configurePreset": "msvc-release"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"name": "clang-windows-debug",
|
|
190
|
+
"displayName": "Build Clang Windows Debug",
|
|
191
|
+
"configurePreset": "clang-windows-debug"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"name": "clang-windows-release",
|
|
195
|
+
"displayName": "Build Clang Windows Release",
|
|
196
|
+
"configurePreset": "clang-windows-release"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "mingw-debug",
|
|
200
|
+
"displayName": "Build MinGW x64 Debug",
|
|
201
|
+
"configurePreset": "mingw-debug"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"name": "mingw-release",
|
|
205
|
+
"displayName": "Build MinGW x64 Release",
|
|
206
|
+
"configurePreset": "mingw-release"
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
}
|
data/sig/Bmp/Bitmap.rbs
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module Bmp
|
|
2
|
+
class Bitmap
|
|
3
|
+
def initialize: () -> NilClass
|
|
4
|
+
| (filename: String) -> NilClass
|
|
5
|
+
| (width: Integer, height: Integer) -> NilClass
|
|
6
|
+
def !: () -> TrueClass
|
|
7
|
+
def !=: (image: Bmp::Bitmap) -> TrueClass
|
|
8
|
+
def ==: (image: Bmp::Bitmap) -> TrueClass
|
|
9
|
+
def []: (i: Integer) -> Bmp::Pixel
|
|
10
|
+
| (i: Integer) -> Bmp::Pixel
|
|
11
|
+
def []=: (arg_0: Integer, arg_1: Bmp::Pixel) -> NilClass
|
|
12
|
+
def clear: (pixel: Bmp::Pixel) -> NilClass
|
|
13
|
+
def draw_circle: (center_x: Integer, center_y: Integer, radius: Integer, color: Bmp::Pixel) -> NilClass
|
|
14
|
+
def draw_line: (x1: Integer, y1: Integer, x2: Integer, y2: Integer, color: Bmp::Pixel) -> NilClass
|
|
15
|
+
def draw_rect: (x: Integer, y: Integer, width: Integer, height: Integer, color: Bmp::Pixel) -> NilClass
|
|
16
|
+
def draw_triangle: (x1: Integer, y1: Integer, x2: Integer, y2: Integer, x3: Integer, y3: Integer, color: Bmp::Pixel) -> NilClass
|
|
17
|
+
def empty?: () -> TrueClass
|
|
18
|
+
def fill_circle: (center_x: Integer, center_y: Integer, radius: Integer, color: Bmp::Pixel) -> NilClass
|
|
19
|
+
def fill_triangle: (x1: Integer, y1: Integer, x2: Integer, y2: Integer, x3: Integer, y3: Integer, color: Bmp::Pixel) -> NilClass
|
|
20
|
+
def flip_h: () -> Bmp::Bitmap
|
|
21
|
+
def flip_v: () -> Bmp::Bitmap
|
|
22
|
+
def fill_rect: (x: Integer, y: Integer, width: Integer, height: Integer, color: Bmp::Pixel) -> NilClass
|
|
23
|
+
def assign: (image: Bmp::Bitmap) -> Bmp::Bitmap
|
|
24
|
+
| (image: Bmp::Bitmap) -> Bmp::Bitmap
|
|
25
|
+
def get: (x: Integer, y: Integer) -> Bmp::Pixel
|
|
26
|
+
| (x: Integer, y: Integer) -> Bmp::Pixel
|
|
27
|
+
def height: () -> Integer
|
|
28
|
+
def initialize_copy: (other: Bmp::Bitmap) -> NilClass
|
|
29
|
+
def inspect: () -> String
|
|
30
|
+
def load: (filename: Std::Filesystem::Path) -> NilClass
|
|
31
|
+
def rotate_90_left: () -> Bmp::Bitmap
|
|
32
|
+
def rotate_90_right: () -> Bmp::Bitmap
|
|
33
|
+
def save: (filename: Std::Filesystem::Path) -> NilClass
|
|
34
|
+
def set: (x: Integer, y: Integer, color: Bmp::Pixel) -> NilClass
|
|
35
|
+
def size: () -> Integer
|
|
36
|
+
def to_s: () -> String
|
|
37
|
+
def width: () -> Integer
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module Bmp
|
|
2
|
+
class BitmapHeader
|
|
3
|
+
attr_accessor bits_per_pixel: Integer
|
|
4
|
+
attr_accessor clr_important: Integer
|
|
5
|
+
attr_accessor clr_used: Integer
|
|
6
|
+
attr_accessor compression: Integer
|
|
7
|
+
attr_accessor file_size: Integer
|
|
8
|
+
attr_accessor height: Integer
|
|
9
|
+
attr_accessor magic: Integer
|
|
10
|
+
attr_accessor offset_bits: Integer
|
|
11
|
+
attr_accessor planes: Integer
|
|
12
|
+
attr_accessor reserved1: Integer
|
|
13
|
+
attr_accessor reserved2: Integer
|
|
14
|
+
attr_accessor size: Integer
|
|
15
|
+
attr_accessor size_image: Integer
|
|
16
|
+
attr_accessor width: Integer
|
|
17
|
+
attr_accessor x_pixels_per_meter: Integer
|
|
18
|
+
attr_accessor y_pixels_per_meter: Integer
|
|
19
|
+
|
|
20
|
+
def initialize: () -> NilClass
|
|
21
|
+
end
|
|
22
|
+
end
|
data/sig/Bmp/Pixel.rbs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module Bmp
|
|
2
|
+
class Pixel
|
|
3
|
+
attr_accessor b: String
|
|
4
|
+
attr_accessor g: String
|
|
5
|
+
attr_accessor r: String
|
|
6
|
+
|
|
7
|
+
def !=: (other: Bmp::Pixel) -> TrueClass
|
|
8
|
+
def initialize: () -> NilClass
|
|
9
|
+
| (rgb: Integer) -> NilClass
|
|
10
|
+
| (red: String, green: String, blue: String) -> NilClass
|
|
11
|
+
def ==: (other: Bmp::Pixel) -> TrueClass
|
|
12
|
+
def assign: (arg_0: Bmp::Pixel) -> NilClass
|
|
13
|
+
def inspect: () -> String
|
|
14
|
+
def to_s: () -> String
|
|
15
|
+
end
|
|
16
|
+
end
|
data/sig/Rice/Arg.rbs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Rice
|
|
2
|
+
class Buffer≺Rice꞉꞉detail꞉꞉ParameterAbstract∗≻
|
|
3
|
+
def initialize: (value: Integer) -> NilClass
|
|
4
|
+
| (value: Integer, size: Integer) -> NilClass
|
|
5
|
+
def []: (index: Integer) -> Rice::Parameter
|
|
6
|
+
def bytes: () -> Integer
|
|
7
|
+
| (arg_0: Integer) -> Integer
|
|
8
|
+
def data: () -> Rice::Pointer≺Rice꞉꞉detail꞉꞉ParameterAbstract∗≻
|
|
9
|
+
def release: () -> Rice::Pointer≺Rice꞉꞉detail꞉꞉ParameterAbstract∗≻
|
|
10
|
+
def size: () -> Integer
|
|
11
|
+
def to_ary: () -> Array
|
|
12
|
+
| (arg_0: Integer) -> Array
|
|
13
|
+
def to_s: () -> Integer
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module Rice
|
|
2
|
+
class Buffer≺char≻
|
|
3
|
+
def initialize: (value: Integer) -> NilClass
|
|
4
|
+
| (value: Integer, size: Integer) -> NilClass
|
|
5
|
+
def []: (index: Integer) -> String
|
|
6
|
+
def []=: (arg_0: Integer, arg_1: String) -> NilClass
|
|
7
|
+
def bytes: () -> Integer
|
|
8
|
+
| (arg_0: Integer) -> Integer
|
|
9
|
+
def data: () -> Rice::Pointer≺char≻
|
|
10
|
+
def release: () -> Rice::Pointer≺char≻
|
|
11
|
+
def size: () -> Integer
|
|
12
|
+
def to_ary: () -> Array
|
|
13
|
+
| (arg_0: Integer) -> Array
|
|
14
|
+
def to_s: () -> Integer
|
|
15
|
+
end
|
|
16
|
+
end
|
data/sig/Rice/Native.rbs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Rice
|
|
2
|
+
class NativeKind
|
|
3
|
+
def initialize: () -> NilClass
|
|
4
|
+
def &: (arg_0: Rice::NativeKind) -> Integer
|
|
5
|
+
def <<: (arg_0: Integer) -> Integer
|
|
6
|
+
def <=>: (arg_0: Rice::NativeKind) -> Integer
|
|
7
|
+
| (arg_0: Integer) -> Integer
|
|
8
|
+
def >>: (arg_0: Integer) -> Integer
|
|
9
|
+
def ^: (arg_0: Rice::NativeKind) -> Integer
|
|
10
|
+
def coerce: (arg_0: Integer) -> Array
|
|
11
|
+
def eql?: (arg_0: Integer) -> TrueClass
|
|
12
|
+
| (arg_0: Rice::NativeKind) -> TrueClass
|
|
13
|
+
def hash: () -> Integer
|
|
14
|
+
def inspect: () -> String
|
|
15
|
+
def to_int: () -> Integer
|
|
16
|
+
def to_s: () -> String
|
|
17
|
+
def |: (arg_0: Rice::NativeKind) -> Integer
|
|
18
|
+
def ~: () -> Integer
|
|
19
|
+
end
|
|
20
|
+
end
|