<commit_before>(ns snippets.image.loading-and-displaying
  (:require [quil.snippet :refer [defsnippet]]
            [quil.core :refer :all]))

(defsnippet image-s {}
  (background 255)
  (let [gr (create-graphics 70 70)]
    (with-graphics gr
      (ellipse 35 35 70 70))

    (image gr 0 0)
    (image gr 100 0 100 70)))

(defsnippet image-mode-s {}
  (background 255)
  (let [gr (create-graphics 100 100)]
    (with-graphics gr
      (fill 0 0 255)
      (stroke 0 0 255)
      (rect 0 0 100 100))
    (stroke-weight 10)

    (image-mode :corner)
    (image gr 50 50)
    (point 50 50)

    (image-mode :center)
    (image gr 250 100)
    (point 250 100)

    (image-mode :corners)
    (image gr 350 50 400 150)
    (point 350 50)
    (point 400 150)))

(defsnippet load-image-s {}
  (let [im (load-image "http://cloud.github.com/downloads/quil/quil/quil.png")]
    (image im 0 0)))

(defsnippet resize-image-s {}
  (let [im (load-image "http://cloud.github.com/downloads/quil/quil/quil.png")]
    (image im 0 0)
    (resize im 50 50)
    (image im 0 0)))

(defsnippet mask-image-s {:renderer :p3d}
  (background 255)
  (let [gr (create-graphics 100 100 :p3d)
        gr2 (create-graphics 100 100 :p3d)
        mask (create-graphics 100 100 :p3d)]
    (with-graphics gr
      (background 0 0 255)
      (stroke-weight 3)
      (stroke 255 0 0)
      (line 0 0 100 100)
      (line 0 100 100 0))

    (with-graphics gr2
      (background 255)
      (stroke 0 255 0)
      (stroke-weight 5)
      (line 0 50 100 50)
      (line 50 0 50 100))

    (with-graphics mask
      (background 0)
      (stroke-weight 5)
      (no-fill)<commit_msg>Fix url. Processing doesn't understand 301 Moved permanently HTTP response.<commit_after>(ns snippets.image.loading-and-displaying
  (:require [quil.snippet :refer [defsnippet]]
            [quil.core :refer :all]))

(defsnippet image-s {}
  (background 255)
  (let [gr (create-graphics 70 70)]
    (with-graphics gr
      (ellipse 35 35 70 70))

    (image gr 0 0)
    (image gr 100 0 100 70)))

(defsnippet image-mode-s {}
  (background 255)
  (let [gr (create-graphics 100 100)]
    (with-graphics gr
      (fill 0 0 255)
      (stroke 0 0 255)
      (rect 0 0 100 100))
    (stroke-weight 10)

    (image-mode :corner)
    (image gr 50 50)
    (point 50 50)

    (image-mode :center)
    (image gr 250 100)
    (point 250 100)

    (image-mode :corners)
    (image gr 350 50 400 150)
    (point 350 50)
    (point 400 150)))

(defsnippet load-image-s {}
  (let [im (load-image "https://cloud.github.com/downloads/quil/quil/quil.png")]
    (image im 0 0)))

(defsnippet resize-image-s {}
  (let [im (load-image "https://cloud.github.com/downloads/quil/quil/quil.png")]
    (image im 0 0)
    (resize im 50 50)
    (image im 0 0)))

(defsnippet mask-image-s {:renderer :p3d}
  (background 255)
  (let [gr (create-graphics 100 100 :p3d)
        gr2 (create-graphics 100 100 :p3d)
        mask (create-graphics 100 100 :p3d)]
    (with-graphics gr
      (background 0 0 255)
      (stroke-weight 3)
      (stroke 255 0 0)
      (line 0 0 100 100)
      (line 0 100 100 0))

    (with-graphics gr2
      (background 255)
      (stroke 0 255 0)
      (stroke-weight 5)
      (line 0 50 100 50)
      (line 50 0 50 100))

    (with-graphics mask
      (background 0)
      (stroke-weight 5)
      (no-fill)
{'fraction_non_alphanumeric': 0.1319569120287253, 'fraction_numerical': 0.11340514661879114, 'mean_word_length': 2.3363273453093814, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6431309', 'n_tokens_mistral': 1574, 'n_tokens_neox': 1185, 'n_words': 392}