This file contains 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
package cornerContour._application; | |
import starling.rendering.IndexData; | |
import starling.rendering.VertexData; | |
import openfl.display.Sprite; | |
import openfl.events.Event; | |
import openfl.display.Graphics; | |
import openfl.display.BitmapData; | |
import openfl.geom.Vector3D; | |
// contour code |
This file contains 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
public inline | |
function mitreDraw( ax_: Float, ay_: Float, bx_: Float, by_: Float, width_: Float, clockWise: Bool ){ | |
// bx_, by_ currently not required... but incase. | |
// work out the opposite point to j, ie the mitre corner. | |
// calculate the difference from centre | |
var deltaX = ax_ - jx; | |
var deltaY = ay_ - jy; | |
// reflect j in relation to a | |
var mitreCornerX = ax_ + deltaX; | |
var mitreCornerY = ay_ + deltaY; |
This file contains 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
public inline | |
function channelBlend( ch0: PixelChannel | |
, ch1: PixelChannel | |
, ch2: PixelChannel | |
, ch3: PixelChannel ){ | |
var a1: Float = c0; // abstract conversion | |
var r1: Float = c1; | |
var g1: Float = c2; | |
var b1: Float = c3; | |
var a2: Float = ch0; |
This file contains 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
(function ($hx_exports, $global) { "use strict"; var $hx_script = (function (exports, global) { // Generated by Haxe 4.3.3 | |
(function ($hx_exports, $global) { "use strict"; | |
$hx_exports["lime"] = $hx_exports["lime"] || {}; | |
var $hxClasses = {},$estr = function() { return js_Boot.__string_rec(this,''); },$hxEnums = $hxEnums || {},$_; | |
function $extend(from, fields) { | |
var proto = Object.create(from); | |
for (var name in fields) proto[name] = fields[name]; | |
if( fields.toString !== Object.prototype.toString ) proto.toString = fields.toString; | |
return proto; | |
} |
This file contains 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
// package iterMagic; | |
https://try.haxe.org/#05CF3741 | |
/* | |
Basic data structure to work with images made of Int, does not provide color specific manipulation. | |
*/ | |
import haxe.ds.GenericStack; // assess to GenericCell | |
import haxe.ds.Vector; | |
typedef BytesInt = haxe.io.Bytes; | |
typedef ArrInt = Array<Int>; |
This file contains 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
function main() { | |
trace("Freya Hermite Monotonic curve"); | |
var w = 0.5; | |
var x = 0.; | |
for( x10 in 0...10 ){ | |
x = x10/10; | |
trace( x + ' : ' + cubicMidpointEaseInOut( x, w ) ); | |
} | |
trace( 1. + ' : ' + cubicMidpointEaseInOut( 1., w ) ); | |
} |
This file contains 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 haxe.ds.Vector; | |
function main() { | |
var a: A<ArrInt> = A.arrInt( 10 ); | |
var v: A<VecInt> = A.vecInt( 10 ); | |
a[3]=1; | |
v[2]=2; | |
trace( a[3] ); | |
trace( v[2] ); | |
} | |
typedef ArrInt = Array<Int>; |
This file contains 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://try.haxe.org/#3C9bD72e | |
import haxe.ds.GenericStack; // assess to GenericCell | |
enum abstract ImageType(Int) { | |
var BYTES; | |
var ARRAY; | |
var UINT32ARRAY; | |
var VECTOR; | |
var GENERICSTACK; | |
} |
This file contains 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://try.haxe.org/#d6768054 | |
enum abstract ImageType( Int ) { | |
var BYTES; | |
var ARRAY; | |
var UINT32ARRAY; | |
var VECTOR; | |
} | |
@:access( IDataImage ) | |
@:transitive | |
@:multiType |
This file contains 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
class HolderImage{ | |
public var image: IDataImage; | |
public function new( image: IDataImage ){ | |
this.image = image; | |
} | |
} | |
class Test { | |
static function main() { | |
var holderImage = new HolderImage( new ByteImage( 100, 100 ) ); | |
var b = new UInt32ArrayImage(100, 100); |
NewerOlder