details about the pattern parameter ?


#1

hello.I’m using the -quiver command and I was wondering if it’s possible to have thicker lines.
the reference guide talks about patterns : ‘pattern’ is an hexadecimal number starting with ‘0x’.
I’ve looked around but didn’t find infos about those patterns.
Is there a list of the available patterns or some explanations on how to use them ?
thanks in advance.luc


#2

Haven’t looked into -quiver, etc., but I found some info on pattern: https://github.com/dtschump/CImg/issues/88#issuecomment-248520194.

Also take a look at the code: https://raw.githubusercontent.com/dtschump/gmic/master/src/gmic_stdlib.gmic. Check out

  • #@cli quiver
  • #@cli arrow
  • #@cli line

#3

thank you very much!


(David Tschumperlé) #4

The pattern parameter does not allow to manage the thickness of the drawing, but only the hatch pattern.
Basically each bit set of pattern means there is a point drawn, while 0 means no point is drawn.
Usual patterns :

  • 0xFFFFFFFF : all bits set so the line is plain (this is the default)
  • 0xAAAAAAAA : one pixel drawn for two pixels considered.
  • 0xCCCCCCCC : two consecutive pixels drawn for four pixels considered.

If you need thick lines, you have to use a trick, like -dilate 2 on your drawing afterwards, or drawing multiple primitives with shifted coordinates.


#5

thanks for the infos and trick… :sunny: