News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Affine transformation

Started by guga, November 10, 2020, 06:20:09 PM

Previous topic - Next topic

guga

Hi Guys

Someone already tried to do some Affine transformations with GDIPlus directly from the pixel data of a image ?


I´m reading some examples here

https://www.codeproject.com/Tips/516761/Affine-Transformations-in-Computer-Graphics
https://github.com/LidaPetr/affine-transformation/blob/master/aurora.cpp
https://engineerslaboratory.wordpress.com/2016/08/27/affine-transformation-in-image-processing-explained-with-c/
https://en.wikipedia.org/wiki/Affine_transformation

Maybe could be a good idea to give a try. I wonder if using gdi plus to retrieve the pixel data and manipulating it directly to perform those tranformations could be faster the using the gdi+ apis itself. ?
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

TouEnMasm


Try to complie the first,little problem "#include <graphics.h>" no more exist.
Seem to be an old sample ,some says it's directx and some says it's opengl ????
Fa is a musical note to play with CL

TimoVJL

https://sourceforge.net/projects/openbgi/

https://github.com/nirin/WinBGI
May the source be with you

TouEnMasm


Thanks for links
https://github.com/nirin/WinBGI     ;works (without errors !!!) with win10 VS2019 C++

Fa is a musical note to play with CL

TouEnMasm

First sample compiled ,works 64 in dos or Windows mode.Stop with spacebar.
Library too big for the forum.
can surely be done more easily with opengl. http://masm32.com/board/index.php?topic=8885.msg97287#msg97287

second sample
Quote
Microsoft Windows [version 10.0.19042.572]
(c) 2020 Microsoft Corporation. Tous droits réservés.

H:\ecrase>math
Affine Transformation is being created
Affine Transformation is being created
Affine Transformation is being created
Initial values:
1 0
Transformation:
3 -3
Inverse Transformation:
1 -2.22045e-16
Combined Transformation:
1 0

H:\ecrase>
Fa is a musical note to play with CL

TimoVJL

With these dll's it worked in Windows 7
May the source be with you

guga

Quote from: TouEnMasm on November 11, 2020, 03:11:27 AM
First sample compiled ,works 64 in dos or Windows mode.Stop with spacebar.
Library too big for the forum.
can surely be done more easily with opengl. http://masm32.com/board/index.php?topic=8885.msg97287#msg97287

second sample
Quote
Microsoft Windows [version 10.0.19042.572]
(c) 2020 Microsoft Corporation. Tous droits réservés.

H:\ecrase>math
Affine Transformation is being created
Affine Transformation is being created
Affine Transformation is being created
Initial values:
1 0
Transformation:
3 -3
Inverse Transformation:
1 -2.22045e-16
Combined Transformation:
1 0

H:\ecrase>

:dazzled: :dazzled: :dazzled: :dazzled:

How did you managed to compiled ? Can it be one in VisualStudio and for x86 ?

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

avcaballero

Well, this is an example on GDI, rotating and scaling, if you are interested in source code:
http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=6#Rotozoomer

Using matrices to achieve such transformations is easy, I could make an example when have time

Here an example using a bitmap, it can accept any bmp file (drag and drop)
http://masm32.com/board/index.php?topic=7145.msg88350#msg88350

TouEnMasm

Quote
How did you managed to compiled ? Can it be one in VisualStudio and for x86 ?
On windows 10 with c++ of visual studio 2019,64 bits
* First step download the c++ project for the winbgi library (upper post,master....)
   del the soluce,open the project,compile with visual studio,He is very easy to compile in 32 or 64(no one error).
   When it is done,dowload the source code i have posted,made it compilable,it is compiled with command line,not visual studio.
* Now you have just to delet the code (except  include and lib),replace the code by the second sample,It much work at the first time.

You can made a batch with that

EditMasmIni
Pour les variables d'environnements:
-* l'ancienne variable,si elle existe,est remplacé entièrement
-* chaque chemin s'ajoute,le ; est ajouté
Par défaut,le mot suivant EditMasmIni (en début de ligne) est considéré comme une variable
d'environnement,à moins qu'il ne fasse partie de la liste de mots réservés


EditMasmIni RESERVELISTE
;rien pour l'instant , éventuel futur


EditMasmIni Platform
X64

EditMasmIni PATH
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\Hostx64\x64
C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64

EditMasmIni LIB
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x64
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\lib\x64

EditMasmIni INCLUDE
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include

EditMasmIni PROCESSEUR
X64

EditMasmIni CL
/c /FA /Gm- /GS- /Ox /MD

EditMasmIni LINK
/NOLOGO

EditMasmIni FindeEditMasmIni

Fa is a musical note to play with CL

guga

Quote from: caballero on November 11, 2020, 08:36:15 AM
Well, this is an example on GDI, rotating and scaling, if you are interested in source code:
http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=6#Rotozoomer

Using matrices to achieve such transformations is easy, I could make an example when have time

Here an example using a bitmap, it can accept any bmp file (drag and drop)
http://masm32.com/board/index.php?topic=7145.msg88350#msg88350

Tks, Caballero

Please, when you have some time, try making some examples of transformations using matrices (whose pixel where retrieved from bitmap etc )
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

avcaballero


guga

 :dazzled: :dazzled: :dazzled: :dazzled:

Tks a lot, caballero :thumbsup: :thumbsup: :thumbsup:

Great Work :thumbsup:
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