1

I don't understand why in PHP when using the imageantialias function you need to pass in a Bool to say if you want to enable anti-aliasing or not.

It feels counter intuitive to call a function with a parameter to say don't do anything.

Is there a use case for calling it with false that I am missing?

Toby
  • 8,483
  • 13
  • 45
  • 68
  • Perhaps to disable anti-aliasing on an image that is already enabled for anti-aliasing ... ie process the same image twice – Manse Jan 05 '12 at 12:18

2 Answers2

2

Passing false doesn't tell the function to do nothing, but to turn antialiasing off, if it was on. A usecase would be drawing to an image with antialiasing, later wanting to draw some more without antialiasing.

Eugen Rieck
  • 64,175
  • 10
  • 70
  • 92
  • Ah, excellent - I didn't know you could turn anti-aliasing off on an image that had already had it. That makes much more sense. – Toby Jan 05 '12 at 12:22
1

This is an enable/disable function.

So if I call:

imageantialias($image, TRUE);

...then anti-aliasing is enabled for $image. And if I then call:

imageantialias($image, FALSE);

I have disabled it again.

DaveRandom
  • 87,921
  • 11
  • 154
  • 174