-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathtech.v3.libs.buffered-image.html
3 lines (3 loc) · 18 KB
/
tech.v3.libs.buffered-image.html
1
2
3
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>tech.v3.libs.buffered-image documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="highlight/solarized-light.css" /><script type="text/javascript" src="highlight/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a> with <a href="https://github.com/xsc/codox-theme-rdash">RDash UI</a> theme</h2><h1><a href="index.html"><span class="project-title"><span class="project-name">dtype-next</span> <span class="project-version">8.042</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="buffered-image.html"><div class="inner"><span>Buffered Image Support</span></div></a></li><li class="depth-1 "><a href="cheatsheet.html"><div class="inner"><span>Cheatsheet</span></div></a></li><li class="depth-1 "><a href="datatype-to-dtype-next.html"><div class="inner"><span>Why dtype-next?</span></div></a></li><li class="depth-1 "><a href="dimensions-bytecode-gen.html"><div class="inner"><span>Dimensions and Bytecode Generation</span></div></a></li><li class="depth-1 "><a href="overview.html"><div class="inner"><span>Overview</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tech</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>v3</span></div></div></li><li class="depth-3"><a href="tech.v3.datatype.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>datatype</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.argops.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>argops</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.bitmap.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bitmap</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.convolve.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>convolve</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.datetime.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>datetime</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.errors.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-4"><a href="tech.v3.datatype.ffi.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ffi</span></div></a></li><li class="depth-5 branch"><a href="tech.v3.datatype.ffi.clang.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>clang</span></div></a></li><li class="depth-5"><a href="tech.v3.datatype.ffi.graalvm.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>graalvm</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.functional.html"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>functional</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.gradient.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>gradient</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.jna.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>jna</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.jvm-map.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>jvm-map</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.list.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>list</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.locker.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>locker</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.mmap.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mmap</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.mmap-writer.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mmap-writer</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.native-buffer.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>native-buffer</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.nippy.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>nippy</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.packing.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>packing</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.reductions.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>reductions</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.rolling.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rolling</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.sampling.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>sampling</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.datatype.struct.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>struct</span></div></a></li><li class="depth-4"><a href="tech.v3.datatype.wavelet.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>wavelet</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree" style="top: -765px;"><span class="top" style="height: 774px;"></span><span class="bottom"></span></span><span>libs</span></div></div></li><li class="depth-4 branch current"><a href="tech.v3.libs.buffered-image.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>buffered-image</span></div></a></li><li class="depth-4"><a href="tech.v3.libs.neanderthal.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>neanderthal</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>parallel</span></div></div></li><li class="depth-4"><a href="tech.v3.parallel.for.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>for</span></div></a></li><li class="depth-3"><a href="tech.v3.tensor.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>tensor</span></div></a></li><li class="depth-4 branch"><a href="tech.v3.tensor.color-gradients.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>color-gradients</span></div></a></li><li class="depth-4"><a href="tech.v3.tensor.dimensions.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>dimensions</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="tech.v3.libs.buffered-image.html#var-as-ubyte-tensor"><div class="inner"><span>as-ubyte-tensor</span></div></a></li><li class="depth-1"><a href="tech.v3.libs.buffered-image.html#var-buffered-image-.3Edata-buffer"><div class="inner"><span>buffered-image->data-buffer</span></div></a></li><li class="depth-1"><a href="tech.v3.libs.buffered-image.html#var-clone"><div class="inner"><span>clone</span></div></a></li><li class="depth-1"><a href="tech.v3.libs.buffered-image.html#var-downsample-bilinear"><div class="inner"><span>downsample-bilinear</span></div></a></li><li class="depth-1"><a href="tech.v3.libs.buffered-image.html#var-draw-image.21"><div class="inner"><span>draw-image!</span></div></a></li><li class="depth-1"><a href="tech.v3.libs.buffered-image.html#var-image-channel-format"><div class="inner"><span>image-channel-format</span></div></a></li><li class="depth-1"><a href="tech.v3.libs.buffered-image.html#var-image-channel-map"><div class="inner"><span>image-channel-map</span></div></a></li><li class="depth-1"><a href="tech.v3.libs.buffered-image.html#var-image-type"><div class="inner"><span>image-type</span></div></a></li><li class="depth-1"><a href="tech.v3.libs.buffered-image.html#var-image-types"><div class="inner"><span>image-types</span></div></a></li><li class="depth-1"><a href="tech.v3.libs.buffered-image.html#var-interpolation-types"><div class="inner"><span>interpolation-types</span></div></a></li><li class="depth-1"><a href="tech.v3.libs.buffered-image.html#var-load"><div class="inner"><span>load</span></div></a></li><li class="depth-1"><a href="tech.v3.libs.buffered-image.html#var-new-image"><div class="inner"><span>new-image</span></div></a></li><li class="depth-1"><a href="tech.v3.libs.buffered-image.html#var-PDataBufferAccess"><div class="inner"><span>PDataBufferAccess</span></div></a></li><li class="depth-2"><a href="tech.v3.libs.buffered-image.html#var-data-buffer-banks"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>data-buffer-banks</span></div></a></li><li class="depth-1"><a href="tech.v3.libs.buffered-image.html#var-resize"><div class="inner"><span>resize</span></div></a></li><li class="depth-1"><a href="tech.v3.libs.buffered-image.html#var-save.21"><div class="inner"><span>save!</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">tech.v3.libs.buffered-image</h1><div class="doc"><div class="markdown"><p>Bindings to buffered images for the datatype system</p></div></div><div class="public anchor" id="var-as-ubyte-tensor"><h3>as-ubyte-tensor</h3><div class="usage"><code>(as-ubyte-tensor img & _options)</code></div><div class="doc"><div class="markdown"><p>Get the buffered image as a uint8 tensor. Works for byte and integer-buffer backed images.</p></div></div><div class="src-link"><a href="https://github.com/cnuernber/dtype-next/blob/master/src/tech/v3/libs/buffered_image.clj#L262">view source</a></div></div><div class="public anchor" id="var-buffered-image-.3Edata-buffer"><h3>buffered-image->data-buffer</h3><div class="usage"><code>(buffered-image->data-buffer img)</code></div><div class="doc"><div class="markdown"><p>Given a buffered image, return it’s data buffer.</p></div></div><div class="src-link"><a href="https://github.com/cnuernber/dtype-next/blob/master/src/tech/v3/libs/buffered_image.clj#L155">view source</a></div></div><div class="public anchor" id="var-clone"><h3>clone</h3><div class="usage"><code>(clone src-img)</code></div><div class="doc"><div class="markdown"><p>Clone an image into a new buffered image.</p></div></div><div class="src-link"><a href="https://github.com/cnuernber/dtype-next/blob/master/src/tech/v3/libs/buffered_image.clj#L413">view source</a></div></div><div class="public anchor" id="var-downsample-bilinear"><h3>downsample-bilinear</h3><div class="usage"><code>(downsample-bilinear src-img & {:keys [dst-img-width dst-img-height dst-img-type]})</code></div><div class="doc"><div class="markdown"><p>Reduce an image size using bilinear filtering.</p></div></div><div class="src-link"><a href="https://github.com/cnuernber/dtype-next/blob/master/src/tech/v3/libs/buffered_image.clj#L367">view source</a></div></div><div class="public anchor" id="var-draw-image.21"><h3>draw-image!</h3><div class="usage"><code>(draw-image! src-img dst-image & {:keys [src-x-offset src-y-offset src-rect-width src-rect-height dst-x-offset dst-y-offset dst-rect-width dst-rect-height interpolation-type]})</code></div><div class="doc"><div class="markdown"><p>Draw a source image onto a destination image. This can be used for scaling, cropping, or copying images.</p></div></div><div class="src-link"><a href="https://github.com/cnuernber/dtype-next/blob/master/src/tech/v3/libs/buffered_image.clj#L328">view source</a></div></div><div class="public anchor" id="var-image-channel-format"><h3>image-channel-format</h3><div class="usage"><code>(image-channel-format img)</code></div><div class="doc"><div class="markdown"><p>Get the image channel format of the buffered image. Formats returned may be: :gray :bgr :rgb :abgr :argb :abgr-pre :argb-pre</p></div></div><div class="src-link"><a href="https://github.com/cnuernber/dtype-next/blob/master/src/tech/v3/libs/buffered_image.clj#L54">view source</a></div></div><div class="public anchor" id="var-image-channel-map"><h3>image-channel-map</h3><div class="usage"><code>(image-channel-map img)</code></div><div class="doc"><div class="markdown"><p>Get a map from keyword channel name to channel index in a ubyte tensor</p></div></div><div class="src-link"><a href="https://github.com/cnuernber/dtype-next/blob/master/src/tech/v3/libs/buffered_image.clj#L72">view source</a></div></div><div class="public anchor" id="var-image-type"><h3>image-type</h3><div class="usage"><code>(image-type img)</code></div><div class="doc"><div class="markdown"><p>Get the image type of a buffered image as a keyword.</p></div></div><div class="src-link"><a href="https://github.com/cnuernber/dtype-next/blob/master/src/tech/v3/libs/buffered_image.clj#L48">view source</a></div></div><div class="public anchor" id="var-image-types"><h3>image-types</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Mapping from keywords to integer buffered image types</p></div></div><div class="src-link"><a href="https://github.com/cnuernber/dtype-next/blob/master/src/tech/v3/libs/buffered_image.clj#L26">view source</a></div></div><div class="public anchor" id="var-interpolation-types"><h3>interpolation-types</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Map of keyword to buffered image rendering hint.</p></div></div><div class="src-link"><a href="https://github.com/cnuernber/dtype-next/blob/master/src/tech/v3/libs/buffered_image.clj#L321">view source</a></div></div><div class="public anchor" id="var-load"><h3>load</h3><div class="usage"><code>(load fname-or-stream)</code></div><div class="doc"><div class="markdown"><p>Load an image. There are better versions of this in tech.io</p></div></div><div class="src-link"><a href="https://github.com/cnuernber/dtype-next/blob/master/src/tech/v3/libs/buffered_image.clj#L303">view source</a></div></div><div class="public anchor" id="var-new-image"><h3>new-image</h3><div class="usage"><code>(new-image height width img-type)</code></div><div class="doc"><div class="markdown"><p>Create a new buffered image. img-type is a keyword and must be one of the keys in the image-types map. ** Arguments are reverse of the buffered image constructor **</p></div></div><div class="src-link"><a href="https://github.com/cnuernber/dtype-next/blob/master/src/tech/v3/libs/buffered_image.clj#L293">view source</a></div></div><div class="public anchor" id="var-PDataBufferAccess"><h3>PDataBufferAccess</h3><h4 class="type">protocol</h4><div class="usage"></div><div class="doc"><div class="markdown"></div></div><div class="members"><h4>members</h4><div class="inner"><div class="public anchor" id="var-data-buffer-banks"><h3>data-buffer-banks</h3><div class="usage"><code>(data-buffer-banks item)</code></div><div class="doc"><div class="markdown"></div></div></div></div></div><div class="src-link"><a href="https://github.com/cnuernber/dtype-next/blob/master/src/tech/v3/libs/buffered_image.clj#L99">view source</a></div></div><div class="public anchor" id="var-resize"><h3>resize</h3><div class="usage"><code>(resize src-img new-width new-height {:keys [resize-algorithm dst-img-type]})</code></div><div class="doc"><div class="markdown"><p>Resize an image. Options - * resize-algorithm - One of #{:bilinear :cubic :nearest}. Defaults to - if the new width is larger than then old width, bilinear is chosen else nearest is chosen. * dst-img-type - Defaults to the src image type. Should be one of the keys of image-types.</p></div></div><div class="src-link"><a href="https://github.com/cnuernber/dtype-next/blob/master/src/tech/v3/libs/buffered_image.clj#L388">view source</a></div></div><div class="public anchor" id="var-save.21"><h3>save!</h3><div class="usage"><code>(save! img format-str fname-or-stream)</code><code>(save! img fname-str)</code></div><div class="doc"><div class="markdown"><p>Save an image. Format-str can be things like “PNG” or “JPEG”. There are better versions of this in tech.io.</p></div></div><div class="src-link"><a href="https://github.com/cnuernber/dtype-next/blob/master/src/tech/v3/libs/buffered_image.clj#L310">view source</a></div></div></div></body></html>