https://threejs.org/examples/?q=point#webgl_buffergeometry_points
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import PDFKit | |
let pdfDocumentOptions = [ | |
kCGPDFContextCreator: "@mbotsu", | |
kCGPDFContextAuthor: "@mbotsu", | |
kCGPDFContextTitle: "Create and combine PDFs with SwiftUI layouts", | |
kCGPDFContextSubject: "Give up ImageRenderer and create PDFs with UIGraphicsPDFRenderer", | |
] as [PDFDocumentWriteOption : Any] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
@State var pdfUrl: URL? | |
var body: some View { | |
VStack { | |
if let pdfUrl = pdfUrl { | |
PreviewView(url: pdfUrl) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/opencv/opencv/blob/master/modules/imgcodecs/src/ios_conversions.mm | |
// https://github.com/opencv/opencv/blob/master/modules/imgcodecs/src/apple_conversions.mm | |
func MatToCGImage(image:Mat) -> CGImage? { | |
let data = Data(bytes: image.dataPointer(), count: image.step1() * Int(image.rows())) | |
let colorSpace = image.elemSize() == 1 ? CGColorSpaceCreateDeviceGray() : CGColorSpaceCreateDeviceRGB() | |
let provider = CGDataProvider(data: data as CFData); | |
let alpha = image.channels() == 4; | |
let bitmapInfo: CGBitmapInfo = CGBitmapInfo(rawValue: (alpha ? CGImageAlphaInfo.last : CGImageAlphaInfo.none).rawValue | CGBitmapInfo.byteOrderDefault.rawValue) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import WebKit | |
enum WebViewError: Error { | |
case contentConversion(String) | |
case emptyFileName | |
case inivalidFilePath | |
var message: String { | |
switch self { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import cv2 | |
import numpy as np | |
import tensorflow as tf | |
def preprocess_input(image_name, height, width): | |
src = cv2.imread(image_name, cv2.IMREAD_GRAYSCALE) | |
ratio = float(src.shape[1]) / float(src.shape[0]) | |
tw = int(height * ratio) | |
rsz = cv2.resize(src, (tw, height), interpolation=cv2.INTER_AREA).astype(np.float32) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension OutputStream { | |
func write(data: Data) -> Int { | |
return data.withUnsafeBytes { | |
write($0.bindMemory(to: UInt8.self).baseAddress!, maxLength: data.count) | |
} | |
} | |
var data: Data? { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.XR.iOS; | |
public class MyGenerateImageAnchor : MonoBehaviour { | |
[SerializeField] | |
private ARReferenceImage referenceImage; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
// https://www.csharpcodi.com/vs2/1607/MBINCompiler/MBINCompiler/HalfHelper.cs/ | |
public static class HalfHelper | |
{ | |
private static uint[] mantissaTable = GenerateMantissaTable(); | |
private static uint[] exponentTable = GenerateExponentTable(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using Windows.Kinect; | |
using System.Runtime.InteropServices; | |
using System; | |
using System.Linq; | |
using UnityEngine.Rendering; | |
[RequireComponent(typeof(MeshRenderer))] | |
[RequireComponent(typeof(MeshFilter))] | |
public class KinectView : MonoBehaviour { |