• December 03, 2021, 07:29:34 AM

Author Topic: (Question) I have an idea but also a problem!  (Read 354 times)

0 Members and 1 Guest are viewing this topic.

Offline Microfractal

  • I like deep mandelbrot zooms!
  • Fractal Furball
  • ***
  • Posts: 262
(Question) I have an idea but also a problem!
« on: November 16, 2021, 05:51:43 PM »
Hello, I’m a pretty beginner in programming. But I have already written a calculator – script (shunting yard algorithm: https://en.wikipedia.org/wiki/Shunting-yard_algorithm) with which you can display complex functions, see this: https://fractalforums.org/image-threads/25/text-fractals/4106/15

A few months ago I started generating fractal images. But the colors of it were boring.
So I wanted to create a small program in ’scratch', a really simple beginner programming language with which I could create some colors. Below also some pictures of the program. The only drawback is that you don’t see what the end result looks like. In other words: you have to copy the palette from the program and paste it into a kfr or kfp file. Only when the kfr or kfp file is opened, you see the result as a picture.

Since a few weeks I have a goal:
To develop a program in a 'real' programming language, which resembles the last one (pictures below).

The important thing is that you can insert kfb (or maybe exr) files into the program, and then load the palette, edit it with : curves (RGB, HSL etc...), math , color mixers etc. and the output palette is automatically applied to the kfb image.

the only problem is that i'm a beginner in programming. I can't get the simple interface library 'nana' for c++ to work, for example.
In between I looked at java again, but there are also small errors. (for c++, i use mingw)

i'm pretty much at the end. Maybe you have a ideas and suggestions how I could get this done.

Linkback: https://fractalforums.org/index.php?topic=4500.0


Offline claude

  • 3f
  • ******
  • Posts: 2081
    • mathr.co.uk
Re: I have an idea but also a problem!
« Reply #2 on: November 16, 2021, 06:42:05 PM »
OpenEXR library is for C++.

GUI options for C++ on Windows in no particular order:

- windows (oldschool like KF)
- wxwidgets (audacity uses this)
- gtk (I use this in m-perturbator-gtk)
- qt (FragM uses this)
- sdl/glfw for OpenGL with dear imgui (I use this in zoomasm)

things to consider:
- cross-platform?
- license? (will it affect how you want to distribute your program?)
- documentation? (are there examples and tutorials?)
- features? (does it have all the widgets you need? can you code custom widgets easily?)

Offline Microfractal

  • I like deep mandelbrot zooms!
  • Fractal Furball
  • ***
  • Posts: 262
Re: I have an idea but also a problem!
« Reply #3 on: November 16, 2021, 06:58:48 PM »
I must have tried to use over 10 different libraries. Only with sdl have I managed to open a window. what exactly does kf use now? This is the library I am looking for. I would like to publish the program and it should not only work on windows but also on linux. The library must be able to do the following: sliders, buttons, checkboxes, user input, displaying text, draw images (and curves like in the color dialog) and small buttons to increase/decrease values (everything like in the Mandelmachine).


Offline claude

  • 3f
  • ******
  • Posts: 2081
    • mathr.co.uk
Re: I have an idea but also a problem!
« Reply #4 on: November 16, 2021, 09:16:09 PM »
KF uses old Windows win32 API, dating from before Windows XP (for the most part) but still supported by Microsoft it seems.  I wouldn't recommend it, it's very awkward compared to modern toolkits (e.g. changing layout of a window means editing all the X/Y coordinates of all the widgets in a text file).

Offline Dinkydau

  • Uploader
  • *
  • Posts: 304
    • DeviantART gallery
Re: I have an idea but also a problem!
« Reply #5 on: November 17, 2021, 10:09:09 PM »
Have you created the program that those 3 screenshots are from? How? It looks like you can already create something visual so I don't understand what prevents you from expanding it with the functionality you want.

The benefit of the win32 api is that you don't need libraries to use it. If you have a compiler for windows you can compile the code immediately. In my view:
win32 api: easy to get started, very difficult to use
other libraries: difficult to get started, easy to use when it finally works

It's worth using a library.

Win32 api programs can be used in linux with wine, mostly. There are some features that don't work such as StretchBlt (which is also slow so I recommend avoiding that function).

I know nana also works in linux with wine because I tested that. What it does is create a window with the win32 api, and then it draws everything by itself, so automatically that works in linux. It doesn't depend on obscure windows api features for drawing. A nana window is like a simple window with a bitmap that it colors pixel by pixel, and there is logic so that clicking at certain pixels (where it draws a button for example) causes actions. (This may be oversimplified.) What happens when you click at a nana window is this: there is a message loop that is constantly either working or waiting for new messages. When you click, the OS resumes the execution of that message loop. Another windows api call is needed to request the location of the click, which is then used to determine what action should be taken. If you use the win32 api you need to program this stuff yourself. If you use nana, nana does this for you.

Offline Microfractal

  • I like deep mandelbrot zooms!
  • Fractal Furball
  • ***
  • Posts: 262
Re: I have an idea but also a problem!
« Reply #6 on: November 17, 2021, 10:13:27 PM »
This is a scratch (or turbowarp file) with a REALLY SIMPLE language! see this: https://turbowarp.org

Offline Microfractal

  • I like deep mandelbrot zooms!
  • Fractal Furball
  • ***
  • Posts: 262
Re: I have an idea but also a problem!
« Reply #7 on: November 17, 2021, 10:16:45 PM »
The only thing is: no file support!
Impossible to load a text file for example!
The goal of my program is to load a kfb file (or so) and apply the edited output palette directly on the kfb :D

Offline 3DickUlus

  • Administrator
  • *******
  • Posts: 2586
    • Digilantism
Re: I have an idea but also a problem!
« Reply #8 on: November 18, 2021, 01:59:25 AM »
Here is a little project I threw together from some old sources I had lying around, it's a standalone dialog that can easily be integrated into any Qt C++ project.

It loads kfr files or png files and it shouldn't be too hard to gut it and insert your own code or at the very least you can use this project as a template to get you up and running.

Instructions are simple...

Ensure you have the Qt development environment and tools necessary.

Unzip the attached file.

cd to QtfPal/build folder
type cmake ..
type make
type ./QtfPal

and you should see something like the image with the RGB boxes, the other image is a comparison of SFTC using QtfPal and KallesFractaler palette interface.

This dialog was specifically designed for SFTC using Qts signal/slot mechanism I think it's a good example of what can be done with Qt.

There is a short video of the more complex feature of the dialog included in the zip.

I hope this can help you decide on how to proceed.  :thumbs:

Offline Dinkydau

  • Uploader
  • *
  • Posts: 304
    • DeviantART gallery
Re: I have an idea but also a problem!
« Reply #9 on: November 22, 2021, 06:55:36 AM »
I have written a detailed guide how to compile nana and my program: https://github.com/DinkydauSet/ExploreFractals/wiki/Compiling-with-GCC

I have also recorded a video of the process: https://www.youtube.com/watch?v=viamXKOPxxY

This is something I wanted to do already. Maybe it helps. Out of the GUI libraries I only have experience with nana.

Offline Microfractal

  • I like deep mandelbrot zooms!
  • Fractal Furball
  • ***
  • Posts: 262
Re: I have an idea but also a problem!
« Reply #10 on: November 22, 2021, 07:55:51 PM »
Yes this is working :D (I think my old c++ compiler was broken... the url linked compiler was correct!)


xx
"Time Span"

Started by cricke49 on Fractal Image Gallery

0 Replies
1178 Views
Last post August 02, 2018, 07:05:21 AM
by cricke49
clip
A new style of fractal imagery using fractal neural style transfer

Started by iRyanBell on Fractal Image Gallery

4 Replies
1836 Views
Last post July 18, 2021, 03:47:45 AM
by Chris_M_Thomasson
xx
A Crazy Idea - The Ability to Make Any Image A Fractal And Then Hybridize It.

Started by Tas_mania on Mandelbulber

5 Replies
897 Views
Last post November 05, 2017, 03:51:20 AM
by Tas_mania
xx
Birdie Style

Started by gannjondal on Fractal Image Gallery

1 Replies
1005 Views
Last post May 08, 2018, 02:39:37 PM
by who8mypnuts
clip
Neural Style Transfer with Fractal Art

Started by reallybigname on Other Artforms

1 Replies
876 Views
Last post July 20, 2019, 04:25:41 PM
by reallybigname