[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #55632] display of image pixels and axis limit
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #55632] display of image pixels and axis limits |
Date: |
Sun, 3 Feb 2019 21:03:10 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko |
Follow-up Comment #2, bug #55632 (project octave):
Since images are primitive graphics objects in Matlab and Octave, it seems
that we probably need to change the rendering code in gl-render.cc. Maybe we
can take some of the code from the implementation of surfaces with texturemaps
and apply it to images, although that might be excessively complicated. I
haven't looked.
Here is the documentation about the xdata property for images in Matlab.
XData — Placement along x-axis
[1 size(CData,2)] (default) | two-element vector | scalar
Placement along the x-axis, specified in one of these forms:
Two-element vector — Use the first element as the location for the
center of CData(1,1) and the second element as the location for the center of
CData(m,n), where [m,n] = size(CData). Evenly distribute the centers of the
remaining CData elements between those two points.
The width of each pixel is determined by the expression:
(XData(2)-XData(1))/(size(CData,2)-1)
If XData(1) > XData(2), then the image is flipped left-right.
Scalar — Center CData(1,1) at this location and each following element
one unit apart.
It is very clear that the property specifies the centers of the pixels and
that the pixels extend to either side of the center. So if I put a pixel at
location 1, and then make the axis start at location 1, I really should have
something drawn.
Here is slightly different code I used to test the extension of pixels in
Matlab.
clf;
colormap (gray (64));
image (1:64, linspace (0, 1, 64), repmat ((1:64)', 1, 64));
axis ([-2, -2, -1, 2], "xy");
I've attached the result as pixel.png. It shows that the pixel does extend to
0.5 as expected.
(file #46174)
_______________________________________________________
Additional Item Attachment:
File name: pixel.png Size:5 KB
<https://savannah.gnu.org/file/pixel.png?file_id=46174>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?55632>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #55632] display of image pixels and axis limits, Rik, 2019/02/02
- [Octave-bug-tracker] [bug #55632] display of image pixels and axis limits, Pantxo Diribarne, 2019/02/03
- [Octave-bug-tracker] [bug #55632] display of image pixels and axis limits, Pantxo Diribarne, 2019/02/03
- [Octave-bug-tracker] [bug #55632] display of image pixels and axis limits,
Rik <=
- [Octave-bug-tracker] [bug #55632] display of image pixels and axis limits, Rik, 2019/02/05
- [Octave-bug-tracker] [bug #55632] display of image pixels and axis limits, Pantxo Diribarne, 2019/02/08
- [Octave-bug-tracker] [bug #55632] display of image pixels and axis limits, Pantxo Diribarne, 2019/02/08
- [Octave-bug-tracker] [bug #55632] display of image pixels and axis limits, Pantxo Diribarne, 2019/02/08
- [Octave-bug-tracker] [bug #55632] display of image pixels and axis limits, Rik, 2019/02/08
- [Octave-bug-tracker] [bug #55632] display of image pixels and axis limits, Pantxo Diribarne, 2019/02/09
- [Octave-bug-tracker] [bug #55632] display of image pixels and axis limits, Pantxo Diribarne, 2019/02/12
- [Octave-bug-tracker] [bug #55632] display of image pixels and axis limits, Rik, 2019/02/13