Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 937a919

Browse files
update
1 parent 4b55978 commit 937a919

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//
2+
// ArtFilter.metal
3+
// swiftui-loop-videoplayer-example
4+
//
5+
// Created by Igor Shelopaev on 21.08.25.
6+
//
7+
8+
9+
#include <metal_stdlib>
10+
#include <CoreImage/CoreImage.h>
11+
using namespace metal;
12+
13+
extern "C" { namespace coreimage {
14+
15+
float4 artEffect(sampler src, float t, destination dest) {
16+
float2 d = dest.coord();
17+
float2 uv = samplerTransform(src, d);
18+
float2 sz = samplerSize(src);
19+
20+
const float a = 0.01;
21+
const float lambda = 48.0;
22+
const float k = 6.28318530718 / lambda;
23+
const float w = 1.0;
24+
25+
float yOff = a * sin(d.x * k - w * t);
26+
float2 uv2 = float2(uv.x, clamp(uv.y + yOff, 0.0, sz.y - 1.0));
27+
28+
return src.sample(uv2);
29+
}
30+
31+
} }

‎Tests/swiftui-loop-videoplayerTests/ext+/textArray.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// textArray.swift
33
// swiftui-loop-videoplayer
44
//
5-
// Created by Igor on 21.08.25.
5+
// Created by Igor Shelopaev on 21.08.25.
66
//
77

88
import XCTest

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /