octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Replacing default.img by default image 'cdata'


From: Pantxo Diribarne
Subject: Re: Replacing default.img by default image 'cdata'
Date: Sun, 02 Nov 2014 13:53:29 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2

>> > Hi,
>>
>>       >
>>
>>
>>       > Currently, the call to "image ()" without argument builds an
>>       image object using data loaded from file (default.img). For
>>       consistency with other graphics primitives (and for matlab
>>       compatibility if it is of any importance here), I think octave
>>       should use the default image "cdata" instead.
>>
>>
>>       >
>>
>>
>>       > Do people have an opinion against this modification in
>>       image.m behavior?
>>
>>
>>       >
>>
>>
>>       > Pantxo
>>
>>
>> The default cdata does not appear to be the same as that in default.img? Should the two be made the same? Matlab compatible behavior is to display a default image for the function call image(). Is their cdata equivalent to their default image?
>>
>> cimg = get (0, 'defaultimagecdata');
>> hi = image ();
>> dimg = get (hi, 'cdata');
>> isequal (cimg, dimg)
>>
>> --Rik
>
>from R2014b
>
>cimg = get (0, 'defaultimagecdata');
>hi = image ();
>dimg = get (hi, 'cdata');
>isequal (cimg, dimg)
>
>ans =
>
>     1
>
>Ben

Hi,

The attached minimal changeset brings Octave in line with Matlab for the above behavior. Is it ok to push it?

Then if we want to change the default image "cdata" it is as easy as changing the data in octave-default-image.h and eventually the dimensions in graphics.cc (see default_image_cdata function). The image data should be indexes in the default colormap, which is "jet".

The current default "cdata" represent Octave logo dithered and exported to header file using Gimp. Its dimensions are 64-by-64 as in Matlab. We could eventually use default.img data, even though dimensions (53-by-40) are a bit weird.

Pantxo

Attachment: load_image_cdata.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]