Liking cljdoc? Tell your friends :D

clj-pnm.core

'clj-pnm' core functions namespace.

'clj-pnm' core functions namespace.
raw docstring

assoc-commentsclj/s

(assoc-comments pnm-map comments)

Associates the comments list to the pnm map if it is present and not empty with the :comments key, otherwise returns the map.

Associates the comments list to the pnm map if it is present and not empty
with the :comments key, otherwise returns the map.
raw docstring

blank?clj/s

(blank? s)

Returns true if the string is either nil, empty or contains only whitespace.

Returns true if the string is either nil, empty or contains only whitespace.
raw docstring

comment-line?clj/s

(comment-line? line)

Returns true if a string is considered a Netpbm format comment line (starts with '#' character). Otherwise returns false.

Returns true if a string is considered a Netpbm format comment line (starts with '#' character).
Otherwise returns false.
raw docstring

fourthclj/s

(fourth v)

Returns the fourth element of the collection.

Returns the fourth element of the collection.
raw docstring

get-commentsclj/s

(get-comments v)

Returns all the Netpbm comments lines from the collection of strings.

Returns all the Netpbm comments lines from the collection of strings.
raw docstring

has-comment-segment?clj/s

(has-comment-segment? line)

Returns true if the string line contains '#' character i.e. beginning of the comment segment.

Returns true if the string line contains '#' character i.e.
beginning of the comment segment.
raw docstring

normalize-whitespaceclj/s

(normalize-whitespace v)

Goes through the collection of strings and reduces multiple white-spaces in a string to just one and trims it.

Goes through the collection of strings and reduces multiple white-spaces
in a string to just one and trims it.
raw docstring

parseclj/smultimethod

Parses the vector of Netpbm lines to a map. Supports 'pbm', 'pgm' and 'ppm' formats. Throws an Exception or JS error if format is unsupported.

Parses the vector of Netpbm lines to a map. Supports 'pbm', 'pgm'
and 'ppm' formats. Throws an Exception or JS error if format is unsupported.
raw docstring

read-linesclj/smultimethod

Reads string lines for the given source. In Clojure environments the function supports string and file sources and in ClojureScript environment only string sources.

Reads string lines for the given source. In Clojure environments the
function supports string and file sources and in ClojureScript environment
only string sources.
raw docstring

read-pnmclj/s

(read-pnm pnm)

Main function for reading Netpbm format. Accepts the string or a file and returns a Netpbm map representation.

Main function for reading Netpbm format. Accepts the string or a file
and returns a Netpbm map representation.
raw docstring

read-strclj/s

(read-str s)

Reads the object from the string. In Clojure environment uses 'read-string' and in ClojureScript environment uses 'cljs.reader/read-string'.

Reads the object from the string. In Clojure environment uses 'read-string'
and in ClojureScript environment uses 'cljs.reader/read-string'.
raw docstring

remove-comment-segmentclj/s

(remove-comment-segment line)

Removes the comment segment from a string line if it exists, otherwise return the string unchanged.

Removes the comment segment from a string line if it exists,
otherwise return the string unchanged.
raw docstring

remove-comment-segmentsclj/s

(remove-comment-segments v)

Removes the comment segments from every string line in the collection.

Removes the comment segments from every string line in the collection.
raw docstring

remove-commentsclj/s

(remove-comments v)

Removes all the Netpbm comment lines from the collection of strings.

Removes all the Netpbm comment lines from the collection of strings.
raw docstring

split-on-space-charclj/s

(split-on-space-char s)

Splits the given string on space character returning a vector of the parts.

Splits the given string on space character returning a vector of the parts.
raw docstring

thirdclj/s

(third v)

Returns the third element of the collection.

Returns the third element of the collection.
raw docstring

tokenizeclj/s

(tokenize v)

Tokenizes a collection of strings by splitting each one on space character and flattening the resulting collection.

Tokenizes a collection of strings by splitting each one on space character
and flattening the resulting collection.
raw docstring

write-commentsclj

(write-comments writer comments)

Writes a comment line to a Writer. Prepends the '# ' sequence to the string. The function is exposed only in Clojure environment.

Writes a comment line to a Writer. Prepends the '# ' sequence to the string.
The function is exposed only in Clojure environment.
raw docstring

write-mapclj

(write-map writer m)

Writes the Netpbm bit/value map to a Writer. The function is exposed only in Clojure environment.

Writes the Netpbm bit/value map to a Writer. The function is exposed only in Clojure environment.
raw docstring

write-pnmclj

(write-pnm pnm file-name)

The main function for writing Netpbm format to a file. Accepts a Netpbm map representation and a file name. The function is exposed only in Clojure environment.

The main function for writing Netpbm format to a file. Accepts a Netpbm map representation and a
file name. The function is exposed only in Clojure environment.
raw docstring

writelnclj

(writeln writer line)

Writes a string to a Writer. Appends a newline character to a string first. The function is exposed only in Clojure environment.

Writes a string to a Writer. Appends a newline character to a string first.
The function is exposed only in Clojure environment.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close