<commit_before>import math
use ooc-draw
use ooc-math
use ooc-base
use ooc-draw-gpu
import GraphicBuffer, AndroidContext
GraphicBufferYuv420Semiplanar: class extends RasterYuv420Semiplanar {
	_buffer: GraphicBuffer
	buffer ::= this _buffer
	_stride: Int
	stride ::= this _stride
	_uvOffset: Int
	uvOffset ::= this _uvOffset
	uvPadding ::= (this _uvOffset - this _stride * this _size height)
	init: func ~fromBuffer (=_buffer, size: IntSize2D, =_stride, =_uvOffset) {
		ptr := _buffer lock()
		_buffer unlock()
		length := 3 * this _stride * size height / 2
		byteBuffer := ByteBuffer new(ptr, length, func (buffer: ByteBuffer) {} )
		super(byteBuffer, size, 1, 1)
	}
	init: func (backend: Pointer, nativeBuffer: Pointer, handle: Pointer, size: IntSize2D, format: GraphicBufferFormat, stride: Int, uvOffset: Int) {
		this init(GraphicBuffer new(backend, nativeBuffer, handle, size, stride, format), size, stride, uvOffset)
	}
	free: override func {
		this _buffer free()
		super()
	}
	toRgba: func (context: AndroidContext) -> GpuBgra {
		padding := this _uvOffset - this _stride * this _size height
		extraRows := Int align(padding, this _stride) / this _stride
		height := this _size height + this _size height / 2 + extraRows
		width := this _stride / 4
		rgbaBuffer := GraphicBuffer new(this buffer handle, IntSize2D new(width, height), width, GraphicBufferFormat Rgba8888, GraphicBufferUsage Texture | GraphicBufferUsage Rendertarget)
		result := context createBgra(rgbaBuffer)
		result coordinateSystem = this coordinateSystem
	}
	new: unmangled (kean_draw_gpu_android_graphicBufferYuv420Semiplanar_new) static func ~API (backend: Pointer, nativeBuffer: Pointer, handle: Pointer, size: IntSize2D, stride: Int, format: GraphicBufferFormat, uvOffset: Int) -> This {
		This new(backend, nativeBuffer, handle, size, format, stride, uvOffset)
	}
}<commit_msg>Removed empty function body in GraphicBufferYuv420Semiplanar.ooc.<commit_after>import math
use ooc-draw
use ooc-math
use ooc-base
use ooc-draw-gpu
import GraphicBuffer, AndroidContext
GraphicBufferYuv420Semiplanar: class extends RasterYuv420Semiplanar {
	_buffer: GraphicBuffer
	buffer ::= this _buffer
	_stride: Int
	stride ::= this _stride
	_uvOffset: Int
	uvOffset ::= this _uvOffset
	uvPadding ::= (this _uvOffset - this _stride * this _size height)
	init: func ~fromBuffer (=_buffer, size: IntSize2D, =_stride, =_uvOffset) {
		ptr := _buffer lock()
		_buffer unlock()
		length := 3 * this _stride * size height / 2
		byteBuffer := ByteBuffer new(ptr, length, func (buffer: ByteBuffer))
		super(byteBuffer, size, 1, 1)
	}
	init: func (backend: Pointer, nativeBuffer: Pointer, handle: Pointer, size: IntSize2D, format: GraphicBufferFormat, stride: Int, uvOffset: Int) {
		this init(GraphicBuffer new(backend, nativeBuffer, handle, size, stride, format), size, stride, uvOffset)
	}
	free: override func {
		this _buffer free()
		super()
	}
	toRgba: func (context: AndroidContext) -> GpuBgra {
		padding := this _uvOffset - this _stride * this _size height
		extraRows := Int align(padding, this _stride) / this _stride
		height := this _size height + this _size height / 2 + extraRows
		width := this _stride / 4
		rgbaBuffer := GraphicBuffer new(this buffer handle, IntSize2D new(width, height), width, GraphicBufferFormat Rgba8888, GraphicBufferUsage Texture | GraphicBufferUsage Rendertarget)
		result := context createBgra(rgbaBuffer)
		result coordinateSystem = this coordinateSystem
	}
	new: unmangled (kean_draw_gpu_android_graphicBufferYuv420Semiplanar_new) static func ~API (backend: Pointer, nativeBuffer: Pointer, handle: Pointer, size: IntSize2D, stride: Int, format: GraphicBufferFormat, uvOffset: Int) -> This {
		This new(backend, nativeBuffer, handle, size, format, stride, uvOffset)
	}
}
{'fraction_non_alphanumeric': 0.09670563230605739, 'fraction_numerical': 0.013018065887353878, 'mean_word_length': 5.359797297297297, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5041611', 'n_tokens_mistral': 1261, 'n_tokens_neox': 1189, 'n_words': 383}