Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 10/18/23 in Posts

  1. First of all, keeping the default names for the buttons has never been best practice. While suggesting to have descriptive names for the buttons, this nevertheless is another way to iterate over any group of buttons: for var btn in [Button1, Button2, Button3, Button4, Button5] do btn.Enabled := True; And, no, you can't write [Button1..Button5] here.
  2. Renate Schaaf

    Program freezes when not linked to debugger

    MadExcept can check for frozen main thread, with or without debugger. Just surprised nobody mentioned it.
  3. Fr0sT.Brutal

    Use of dynamic control names

    FindComponent Or better set array of these buttons at form create and then loop through the array
  4. Stefan Glienke

    Testers needed for GExperts Instant Grep expert

    Putting the line number to the left into a gutter just like in the editor would save a lot of vertical space - take a look at the Notepad++ search results window
  5. Renate Schaaf

    Parallel Resampling of (VCL-) Bitmaps

    I know! Just missed the B and C-values for the Robidoux in the table-image you post. And then I just have to rescale the functions to have support in [-1,1], make sure it's integral is 1. Bang. It plugs right in. Wish I could edit my original post and delete the attachment, it's ancient now, and include a link to my GitHub-repo. The AntiNLanczos is a spline to approximate the antiderivative of Lanczos, all that stuff isn't needed anymore.
  6. So inside an application with many forms and Controls you could build a list of Controls addresses by searching by form name and then component name and use list later with getparentform is easy to bringtofront and show needed controls. Or realizing the list when custom controls or even standard controls are loaded at runtime.
  7. I do use lists, i create a list lets, say i want a bunch of controls to be enabled or disabled when a specific value is right/wrong in an edit, register these controls once and use helper function or any other method you like, to enable or disable them, lists are great for grouping. you can hide and show also.
  8. Kas Ob.

    Parallel Resampling of (VCL-) Bitmaps

    Dear, you already did all the right things and implemented contributors, i think you are overthinking it, your implementation is great and you are missing just few things to point you right, all these papers are talking about the weight of the neighbors and reduce them to specific formulas represented mathematically, in this case like here https://en.wikipedia.org/wiki/Mitchell–Netravali_filters , P(d) is referenced by P0, P1, P2, P3 the points in 4 direction from p the point you are calculating, while k(x) is a function calculating the weight, which you are already implemented and using with Lanczos, this implementation is almost universal for all filters as it is the best. now re-read these links, with that in mind and you don't need any source as reference, specially you are going to like this but it is not so clear as and Now you can use the same filter to generate blur and antialiasing or force ringing (halo's and ripple), and can't remember what was the blocking . I browsed your code in "View file" in WinRar , i saw MakeContributors and AntiNLanczos and i confident you can just duplicate AntiNLanczos for all the above in the table with B and C or replace them with the calculated value like mine for faster calculation, while MakeContributors most likely doesn't need any change or a may be a little, i am sure you can solve this as it is way easier than how it sound and look. In AntiNLanczos const sqrt3 = 1.7320508075688; b = -27 * sqrt3 / 2 / Pi; d = -1.4 * 0.8933976645E-1; e = 1.0 * 0.1650337606E-1; a = 0.5 - e - d; function AntiNLanczos(x: double): double; var s: integer; begin s := 1; if x < 0 then begin x := -x; s := -1; end; if x < 1 / 3 then Result := (3 + (-162 + 3 / 2 * b + 270 * a + (648 - 9 * b - 1215 * a + (-729 + 27 / 2 * b + 1458 * a) * x) * x) * sqr(x)) * x else if x < 2 / 3 then Result := 1 / 2 * b - 31 * d + a + (-16 / 3 * b + 360 * d + (177 / 8 * b - 1620 * d + (-357 / 8 * b + 3510 * d + (351 / 8 * b - 3645 * d + (-135 / 8 * b + 1458 * d) * x) * x) * x) * x) * x else if x < 1 then Result := -3 / 2 * b - 512 * e + a + d + (9 * b + 3240 * e + (-171 / 8 * b - 8100 * e + (201 / 8 * b + 9990 * e + (-117 / 8 * b - 6075 * e + (27 / 8 * b + 1458 * e) * x) * x) * x) * x) * x else Result := 0.5; Result := s * Result; end; You need these constants a, b, d and e, with Mitchell–Netravali filters you will need only B and C, result is the weigth (w) and x is param , simple like that, only the difference is you are scaling first to do the clamping with shr 22 later , you can drop it or keep it, just adjust the values accordingly. and good luck, waiting to see your result images, as your sample and demos also not working on older Delphi, and please don't waste your time on compatibility now, i will nag you for that later.
  9. Renate Schaaf

    Parallel Resampling of (VCL-) Bitmaps

    They are in System.Math: function Min(const A, B: Integer): Integer; overload; inline; I had coded it with ifs in a previous version, but I changed that after I noticed the inlining, looks a bit less stupid. Oh, W is the weight you compute, and param is the x of the kernel. So you *did* post the kernel code, I was just too dense to see it. I think Maple and me can take it from there. I tried to find something in their source code, but gave up. Looks like you had a bit more stamina :).
  10. Kas Ob.

    Parallel Resampling of (VCL-) Bitmaps

    It is intimidating at first glance, i offered them because you are using contributors, things for me fall in place when i looked at how imagemagick implemented. Yes these are BiCubic filter, here are the raw formula https://en.wikipedia.org/wiki/Mitchell–Netravali_filters Though you don't need that formula in particular, as the implementation will calculate the contributors, so you need B and C which are mentioned in wikipedia for Mitchell and in https://www.imagemagick.org/Usage/filter/#cubics My code for calculate the contributors are very simple procedure Calc(B, C: Single); begin Memo1.Lines.Add(FloatToStr((1 / 6) * (12 - 9 * B - 6 * C)) + ' * Sqr(Param) * Param + ' + FloatToStr((1 / 6) * (-18 + 12 * B + 6 * C)) + ' * Sqr(Param) + ' + FloatToStr((1 / 6) * (6 - 2 * B))); Memo1.Lines.Add(FloatToStr((1 / 6) * (-B - 6 * C)) + ' * Sqr(Param) * Param + ' + FloatToStr((1 / 6) * (6 * B + 30 * C)) + ' * Sqr(Param) + ' + FloatToStr((1 / 6) * (- 12 * B - 48 * C)) + ' * Param + ' + FloatToStr((1 / 6) * (8 * B + 24 * C))); Memo1.Lines.Add(''); end; var B, C, X: Single; begin Calc(0.3782, 0.3109); Calc(0.262, 0.3690); Calc(0.6796, 0.1602); Calc(1, 0); // for comparison end; the result 1.12180000543594 * Sqr(Param) * Param + -1.93270000815392 * Sqr(Param) + 0.873933335145315 -0.373933335145315 * Sqr(Param) * Param + 1.93270000815392 * Sqr(Param) + -3.24360001087189 * Param + 1.74786667029063 1.23800002038479 * Sqr(Param) * Param + -2.1070000231266 * Sqr(Param) + 0.912666668494542 -0.412666653593381 * Sqr(Param) * Param + 2.10699993371964 * Sqr(Param) + -3.47599989175797 * Param + 1.82533327738444 0.82039999961853 * Sqr(Param) * Param + -1.4805999994278 * Sqr(Param) + 0.77346666653951 -0.27346666653951 * Sqr(Param) * Param + 1.4805999994278 * Sqr(Param) + -2.64079999923706 * Param + 1.54693333307902 0.5 * Sqr(Param) * Param + -1 * Sqr(Param) + 0.666666666666667 -0.166666666666667 * Sqr(Param) * Param + 1 * Sqr(Param) + -2 * Param + 1.33333333333333 These are w (weight) and where param is delta x, i added them on AlphaSkin as i mention and the implementation here doesn't scale by $800 like yours, yet i see no problem in doing so. I suggested to have have a look at ImageMagick, yet i don't see you need to, did nice job with cylindrical filter (Lanczos), and switching to bicubic will be minimum, i think your adjustments will touch only the contributors.
  11. Remy Lebeau

    C++ / windows.h and data alignment

    On 32bit systems, as well. Using the Windows Headers What structure packing do the Windows SDK header files expect?
  12. Kas Ob.

    Parallel Resampling of (VCL-) Bitmaps

    To my past working on resampling and resizing up and down, i found that Mitchell and Robidoux filter is superior to Lanczos(3) in speed and quality specially in halo reduction and color defects. https://legacy.imagemagick.org/Usage/filter/#mitchell https://legacy.imagemagick.org/Usage/filter/nicolas/ I added them to AlphaSkin few years back and it seems i failed to deliver them to the author, shame on me after all that work. Anyway found my old test project, and here a sample of the a result With Lanczos3 the halo effect is very visible inside the boxes and there a skyblue color above the T also there a yellow on left side of the red. While Mitchell and Robidoux (default, sharp and soft) , doesn't have halo and blue but the yellow exist Downsizing As seen above and as i remember with many images, Robidoux sharp was the best for upsizing, and Robidoux soft was the best in downsizing. And here are the parameters for Robidoux ftRobidoux: if Param < 1.0 then W := Sqr(Param) * (1.1218 * Param - 1.9327) + 0.8739 else W := Sqr(Param) * (-0.3739 * Param + 1.9327) - 3.2436 * Param + 1.7478; ftRobidouxSharp: if Param < 1.0 then W := Sqr(Param) * (1.238 * Param - 2.107) + 0.9126 else W := Sqr(Param) * (-0.4126 * Param + 2.1069) - 3.4759 * Param + 1.8253; ftRobidouxSoft: if Param < 1.0 then W := Sqr(Param) * (0.8204 * Param -1.4806) + 0.7734 else W := Sqr(Param) * (-0.2734 * Param + 1.4806) - 2.6408 * Param + 1.5469; No Mitchell though because it is already in AlphaSkin and i don't want to paste code that is not mine.
×