|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
The fine documentation states: "Note: Currently, unsigned 32-bit words are
not supported."
Guess what. I need those.
Is there some trickery with 4 uint8' or 2 uint16le's to get the proper
bytes in the proper place?
TIA,
Ingo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 3/29/21 9:35 AM, ingo wrote:
> The fine documentation states: "Note: Currently, unsigned 32-bit words are
> not supported."
>
> Guess what. I need those.
>
> Is there some trickery with 4 uint8' or 2 uint16le's to get the proper
> bytes in the proper place?
>
For what feature/functionality ?
When writing files I'm not aware of any 32bit write / per channel
capability today in any official version of POV-Ray. If storing values
doubles give you effectively more than 32bits of depth - at the cost of
doubles.
Bill P.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
in news:6062017a$1@news.povray.org William F Pokorny wrote:
> For what feature/functionality ?
>
>
Sorry Bill. I wasn't very clear. For "3.3.2.3.4 The write Directive". It
supports:
sint32be, sint32le - signed 32-bit word (-2^31..2^31-1)
but not uint32.
Ingo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 29.03.2021 18:57, ingo wrote:
> Sorry Bill. I wasn't very clear. For "3.3.2.3.4 The write Directive". It
> supports:
> sint32be, sint32le - signed 32-bit word (-2^31..2^31-1)
> but not uint32.
You can just compute the ones' complement inverse before output, and you
get what you want ;-)
Thorsten
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 29.03.2021 18:57, ingo wrote:
> Sorry Bill. I wasn't very clear. For "3.3.2.3.4 The write Directive". It
> supports:
> sint32be, sint32le - signed 32-bit word (-2^31..2^31-1)
> but not uint32.
You can just compute the two's complement inverse before output, and you
get what you want
Thorsten
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
in news:60620b36$1@news.povray.org Thorsten wrote:
> You can just compute the two's complement inverse before output, and
> you get what you want
>
Sorry Thorsten, I realy don't understand. Can we do it by example.
I have a number, 4321 and it hast to written to a file as uint_32.
Ingo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
ingo <ing### [at] tagpovrayorg> wrote:
> The fine documentation states: "Note: Currently, unsigned 32-bit words are
> not supported."
>
> Guess what. I need those.
>
> Is there some trickery with 4 uint8' or 2 uint16le's to get the proper
> bytes in the proper place?
Hi Ingo
You can try this:
#version 3.7;
#declare AnInteger = 4091728320; // 0xf3e2d1c0
#declare R = AnInteger;
#declare Byte_0 = mod(R, 256);
#declare R = div(R, 256);
#declare Byte_1 = mod(R, 256);
#declare R = div(R, 256);
#declare Byte_2 = mod(R, 256);
#declare R = div(R, 256);
#declare Byte_3 = mod(R, 256);
#fopen SomeFile "LitteEndian.bin" write
#write (SomeFile, uint8 Byte_0)
#write (SomeFile, uint8 Byte_1)
#write (SomeFile, uint8 Byte_2)
#write (SomeFile, uint8 Byte_3)
#fclose SomeFile
#fopen SomeFile "BigEndian.bin" write
#write (SomeFile, uint8 Byte_3)
#write (SomeFile, uint8 Byte_2)
#write (SomeFile, uint8 Byte_1)
#write (SomeFile, uint8 Byte_0)
#fclose SomeFile
#error "Finished"
You can upload the resulting files to this web page: https://hexed.it
- and then inspect the results as both big endian and little endian integeres.
--
Tor Olav
http://subcube.com
https://github.com/t-o-k
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
If you get any of that to work, I would like a very small working code snippet
to paste into my collection of Keyword Examples.
Computing complement inverses would be a nice trick to add in as well.
I'm sticking to the stuff I know how to do already, and saving the "need to
learn that" stuff until later/last.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
in news:web.60620e7f8cf934b8ae6f04a89db30a9@news.povray.org Tor Olav
Kristensen wrote:
>
> #declare AnInteger = 4091728320; // 0xf3e2d1c0
>
> #declare R = AnInteger;
> #declare Byte_0 = mod(R, 256);
> #declare R = div(R, 256);
>
> [.....]
>
Thank you Tor Olav!
Ingo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> You can try this:
Leave it to you to post a full code example before I even finished typing my
request :D (He's too fast for me, folks.)
That ought to give me some more interesting material for div and mod as well.
:)
Thanks for keeping the info flowing - there's always something new to learn.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |