Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fall Banner 2023 Idea - Dev Diary
#9
Previous align and random discussion is also a compositing operation. We don't have x and y positions when we are doing stuff, we have separate image handles, and then we have a destination handle where all of this stuff is going to be drawn to.

So at this point I think we have enough plans to start writing some real code and iteratively discover edge cases and identify places where we can create higher level subs and funcs to make things easier and DRY (Don't Repeat Yourself)

for example, thinking about align and distribute we also need to pass an image handle for the destination image. we could just depend on _DEST and write to whatever it's using, that's definitely one way to do it, but it might be better to be more explicit. so let's add arguments to our pseudo:


`align(x_type$, y_type$, shapes(), dest_img&)`
`distribute(x_type$, y_type$, shapes(), dest_img&)`
`align_random(x_type$, y_type$, shapes(), dest_img&, x_start%, x_end%, y_start%, y_end%)`
`distribute_random(x_type$, y_type$, shapes(), dest_img& , x_start%, x_end%, y_start%, y_end% )`

Now let's pretend to call them.

```
DIM tmp_image AS LONG
```

I started writing and realized that we're going to want to create the _NEWIMAGE INSIDE the sub and here's why. We don't know the width or height of the image, and while we could definitely create something and resize it I supposed, it makes more sense to do it as just a empty `LONG` perhaps... Let's follow this train of thought.

```
'pretend we have a bunch of shape areas in shapes for now we're just seeing if this needs any more higher level stuff
DIM tmp_image AS LONG
align("left", "", shapes(), tmp_image&) ' align them left
_DEST 0 : _SOURCE tmp_image& : _PUTIMAGE
```

So we have 1 line where we simply `_PUTIMAGE` onto another image, in this case `_DEST 0`.

This seems OK by me and having a wrapper that is something silly like "add_to_stage" might not really be helpful here. we need high-level for complexity on the outside, and low-level on the inside. in this case we're doing low-level on the outside, but the level of complexity here is extremely minor.

I think we're ok with what we have now then.
grymmjack (gj!)
GitHubYouTube | Soundcloud | 16colo.rs
Reply


Messages In This Thread
Fall Banner 2023 Idea - Dev Diary - by grymmjack - 09-02-2023, 12:59 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 01:11 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 01:17 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 01:45 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:01 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:07 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:33 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:40 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:49 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 03:18 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 03:29 AM
RE: Fall Banner 2023 Idea - Dev Diary - by dbox - 09-02-2023, 03:37 AM
RE: Fall Banner 2023 Idea - Dev Diary - by dbox - 09-02-2023, 02:02 PM
RE: Fall Banner 2023 Idea - Dev Diary - by bplus - 09-02-2023, 03:29 PM
RE: Fall Banner 2023 Idea - Dev Diary - by bplus - 09-06-2023, 01:59 PM



Users browsing this thread: 4 Guest(s)