Skip to content

Commit

Permalink
(#471) Change crosshair to blue
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicOram committed Apr 26, 2024
1 parent 47dc273 commit ebe5cf7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/dodal/devices/areadetector/plugins/MJPG.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def post_processing(self, image: Image.Image):

class SnapshotWithBeamCentre(MJPG):
CROSSHAIR_LENGTH_PX = 20
CROSSHAIR_COLOUR = "Blue"

def post_processing(self, image: Image.Image):
assert (
Expand All @@ -86,7 +87,13 @@ def post_processing(self, image: Image.Image):

draw = ImageDraw.Draw(image)
HALF_LEN = self.CROSSHAIR_LENGTH_PX / 2
draw.line(((beam_x, beam_y - HALF_LEN), (beam_x, beam_y + HALF_LEN)))
draw.line(((beam_x - HALF_LEN, beam_y), (beam_x + HALF_LEN, beam_y)))
draw.line(
((beam_x, beam_y - HALF_LEN), (beam_x, beam_y + HALF_LEN)),
fill=self.CROSSHAIR_COLOUR,
)
draw.line(
((beam_x - HALF_LEN, beam_y), (beam_x + HALF_LEN, beam_y)),
fill=self.CROSSHAIR_COLOUR,
)

self._save_image(image)

0 comments on commit ebe5cf7

Please sign in to comment.