Kodlama Referansı
## Bootstrap phase
from studio.custom_block import *
# Importing of community modules
import cv2
import numpy as np
## Class Definition
class Example_Block(Block):
op_code = 'Example_Block' # DO NOT CHANGE !!!, must be same as class name
def init(self):
self.width = 200
self.height = 120
self.tooltip = 'Increment image values by one.'
self.input_sockets = [SocketTypes.ImageAny('in1')]
self.output_sockets = [SocketTypes.ImageAny('out1')]
self.param['text1'] = TextInput(text= '5')
def run(self):
in1 = self.input['in1'].data
self.output['out1'].data = in1 + 1
add_block(Example_Block.op_code, Example_Block)

Bootstrap Aşaması
Zorunlu İçe Aktarmalar
Topluluk Modüllerinin İçe Aktarılması
Sınıf Tanımı
Sınıf Nitelikleri-Yöntemleri
`Block.op_code: str`
`Block.tooltip: str`

`Block.input_sockets: list[SocketType]`
`Block.output_sockets: list[SocketType]`
`Block.param: dict[str, Component]`
`Block.input: dict[str, object]`
`Block.output: dict[str, object]`
`Block.register_resource(name: str = '', path: str = '') -> str`
`Block.get_resource(name: str = '') -> str`
`Block.init(self)`
`Block.run(self)`
`QAFileDialog`
`QAFileDialog.getOpenFileName(**kwargs)`
`QAFileDialog.getExistingDirectory`
`add_block(My_Block.op_code, My_Block)`
Last updated