anchor.diff:  
   The multiplication by one forces a copy of the data. This is necessary because under-the-hood `memmapfile` only returns a reference to the underlying memory.
   
  -////
  -We can solve this by doing one of the following
  -
  -* Make the internal logic smart enough to handle cases where users didn't call `unlock`
  -* Use link:https://mathworks.com/help/matlab/ref/oncleanup.html[onCleanup] to guarantee unlocking, e.g., `c = onCleanup(@()unlock(this.javaObj))`
  -* Create a custom class that locks in the constructor and unlocks in the destructor
  -
  -However, even if the `unlock` call is in a destructor (guaranteed to run when exiting scope), the Java logic still needs to handle cases where the code gets interrupted before the `lock` call.
  -////
  -
   == Results
   
  -All benchmarks were run in MATLAB 2017b on an link:https://www.intel.com/content/www/us/en/products/boards-kits/nuc/kits/nuc6i7kyk.html[Intel NUC6I7KYK]. The performance was measured using MATLAB's link:https://mathworks.com/help/matlab/ref/timeit.html[timeit] function. The background color of each cell in the result tables represents a rough classification of the overhead on the main MATLAB thread.
  +All benchmarks were run in MATLAB 2017b on an link:https://www.intel.com/content/www/us/en/products/boards-kits/nuc/kits/nuc6i7kyk.html[Intel NUC6I7KYK]. The performance was measured using MATLAB's `link:https://mathworks.com/help/matlab/ref/timeit.html[timeit]` function. The background color of each cell in the result tables represents a rough classification of the overhead on the main MATLAB thread.
   
   {set:cellbgcolor:white}
   
  
positive.code: 
  *3. Java Layout as 1D Pixel Array*
  
  Another approach is to copy the pixel array of Java's `BufferedImage` and to reshape the memory using MATLAB. This is also the acepted answer for link:https://mathworks.com/matlabcentral/answers/100155-how-can-i-convert-a-java-image-object-into-a-matlab-image-matrix#answer_109503[How can I convert a Java Image object to a MATLAB image matrix?].
  
  [source,matlab]
  ----
  
negative.code: 
  *5. MATLAB Layout as Shared Memory*
  
  The fifth approach is the same as the fourth with the difference that the Java translation layer is bypassed entirely by using shared memory via `link:https://mathworks.com/help/matlab/ref/memmapfile.html[memmapfile]`. Shared memory is typically used for inter-process communication, but it can also be used within a single process. Running within the same process also simplifies synchronization since MATLAB can access Java locks.
  
  [source,matlab]
  ----
  