News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

idea of demo based on rosler attractor

Started by daydreamer, December 03, 2017, 07:36:55 AM

Previous topic - Next topic

daydreamer

#60
HSE 500000points,I think its way too much when zoomed so it becomes many big spheres,so I decided to try code sort them to inside xyzc box and other things
xyzc box lets me control sort size of spheres cant get too big and many min size only pixels
and inspired by unicode flags in other thread of course we must have a flag

.data
align 16
scale1  real4 255.0,255.0,255.0,255.0
RGBA    real4 0.0,0.0,0.0,0.0,0.0
CMYK    real4 0.0,0.0,0.0,0.0,0.0
scale2  real4 0.01,0.01,0.01,0.01
ones    real4 1.0,1.0,1.0,1.0,1.0
.code

PROC CMYKtoRGB
movaps xmm0,CMYK
mulps xmm0,scale2
movaps xmm1,ones
movss xmm2,k
shufps xmm2,xmm2,copytoall ;k,k,k,k
mulps xmm0,scale1
subps xmm1,xmm0
mulps xmm1,xmm2
ret
ENDP

;wrote it in mind to be able to zoom in on attractor,at the same time clip z to not waste system resources draw lots of tiny points and not
;have too close/big objects that both take system resources and fill up the whole screen
PROC CLIPBOX
;ebx=adress of pointbuffer for drawing on screen
movaps xmm0,xyzc ;points
subps xmm0,minxyzc
cmpltps xmm0,maxboxxyzc ;4 less than compares,less than=0FFFFFFFFh,max c=very high number, C could also represent a texturenumber
MOVHLPS xmm1,xmm0
andps xmm1,xmm0 ; perform .IF xy< and zc<
movaps xmm1,xmm0
PSLLQ xmm0,32
andss xmm0,xmm1                    ;increment and copy if inside screen
andss xmm0,increment ;if not inside xyzbox ,increment becomes zero= no copy
movd eax,xmm0
.IF eax!=0
movaps xmm0,xyzc
movaps [EBX]
add ebx,eax
.ENDIF

ret
ENDP


PROC flag
mov eax,XY ;x and y simultanously 256*256 coordinates
and eax,0f0f0h ;must experiment to get right thickness of cross in middle of flag
mov ebx,blue ;ebx =color
.IF al=127 or ah=127 ;horizontal and vertical check if middle of flag
mov ebx,yellow
.ENDIF
ret
ENDP
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

HSE

OK. Your Christmas ball is an square Sweden flag.

What is CMYK?
Equations in Assembly: SmplMath

guga

Hi HSE

CMYK is a colorspace model. It stands for cyan, magenta, yellow and black.  His CMYK to RGB converts the CMYK color space to RGB colors.

https://en.wikipedia.org/wiki/CMYK_color_model


Btw, Daydreamer.

I liked the way you did with SSE. Maybe you could give me a help later trying to adapt my CieLCH using SSE as well to make it faster ?
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

daydreamer

Quote from: guga on January 27, 2019, 12:36:34 PM
Btw, Daydreamer.

I liked the way you did with SSE. Maybe you could give me a help later trying to adapt my CieLCH using SSE as well to make it faster ?
thanks
I started with simplest colorspace conversion first,going to try help you as time permits

@HSE
everything looks better with textures,some textures take more time to code
PROC flag can be used both with 2d coordinates to be used only with 2d bitmap and be used for texture coordinates

my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

guga

#64
Many Tks, daydreamer  :t

I´m finishing the implementation on the backwards operation "CieLCHtoRGB" and see if i can be able to optim9ize what i can before posting it here for us to give a try on SSE.  I suceeded to make usage on the matrix tables to make the conversion faster between the different colorspaces such as Adobe RGB 1998, SECAM etc etc.

I´m using predefined tables for make it goes faster since the function makes heavy use of gamma and white reference values. The maths envolved is a bit hard, but maybe it can be simplified before optimize it further. Plus, with the help of the adaptation transformations we can create tons of different models to use on a single function RGBtoCieLCH and it´s reverse CieLCHtoRGB.

Doing my best here to make it complete as possible and yet fast enought to allow the function to be used in video editing as well and not only image processing :bgrin: :bgrin: :bgrin:

I´m pretty sure, after the code is cleaned it can be optimized further. For example, using a faster way to compute sin, cosine and atan2 operations necessary for CieLCH operations. Siekmanski found a good library that may can be used here: http://masm32.com/board/index.php?topic=4118.120  and http://lolengine.net/wiki/doc/maths/remez
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

daydreamer

my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

daydreamer

so use all 3 in one program,means two is calculated simultanously with some kinda fadeout/fadein
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding