AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Delphi Big endian float value - hot to in Delphi

Big endian float value - hot to in Delphi

Ein Thema von WojTec · begonnen am 16. Feb 2012 · letzter Beitrag vom 17. Feb 2012
Antwort Antwort
WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#1

Big endian float value - hot to in Delphi

  Alt 16. Feb 2012, 17:15
Delphi-Version: 2010
I'm trying read ASE file, unfortunately it storing color values in BE Float32. I added Float32 = Single. Now I have to make little endian from it. How to do it?
  Mit Zitat antworten Zitat
Benutzerbild von BUG
BUG

Registriert seit: 4. Dez 2003
Ort: Cottbus
2.094 Beiträge
 
#2

AW: Big endian float value - hot to in Delphi

  Alt 17. Feb 2012, 02:10

Geändert von BUG (17. Feb 2012 um 02:18 Uhr)
  Mit Zitat antworten Zitat
WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#3

Re: Big endian float value - hot to in Delphi

  Alt 17. Feb 2012, 12:40
I wrote this, could you confirm is it valid?

Delphi-Quellcode:
function ChangeEndian32f(X: Single): Single;
var
  B: packed array [0..3] of Byte absolute X;
  L: packed array [0..3] of Byte;
  I: Integer;
begin
  for I := 0 to 3 do
    L[I] := B[3 - I]
  ;

  Result := Single(L);
end;
I also found this:

Code:
http://edn.embarcadero.com/article/28964
How it working? I don't understand that record?
  Mit Zitat antworten Zitat
Benutzerbild von BUG
BUG

Registriert seit: 4. Dez 2003
Ort: Cottbus
2.094 Beiträge
 
#4

AW: Big endian float value - hot to in Delphi

  Alt 17. Feb 2012, 14:21
I wrote this, could you confirm is it valid?
It looks good to me.

I also found this:

http://edn.embarcadero.com/article/28964

How it working? I don't understand that record?
These records are called variant record and can be used similar to unions in C/C++.
  Mit Zitat antworten Zitat
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:01 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz