comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » How to read 16-bit UNSIGNED data
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
How to read 16-bit UNSIGNED data [message #1749] Fri, 18 February 1994 05:51
knipp is currently offline  knipp
Messages: 68
Registered: January 1993
Member
I have to read image data which are written as 16 Bit per Pixel,
UNSIGNED and with a range of 0 to 65535.

INTEGER Variable in IDL are defined to range from -32767 to 32768.

Is the following way to read the data correct?

OPENR, UNI, FILE, /GET
I = ASSOC(UNI, INTARR(WIDTH,ROW),OFFSET)
IMA = I(0)
FREE_LUN, UNI

IMA2 = LONG(IMA)
POS = WHERE(IMA2 LT 0)
IF POS(0) NE -1 THEN IMA2(POS) = IMA2(POS) + 65535L


Karl

____________________________________________________________ __________________
__ ____ __
/ // _ \ / / Karlheinz Knipp phone: +49 511 - 762 4922
/ // /_/ // / University of Hannover fax: +49 511 - 762 2483
/ // ____// / Institute for Photogrammetry
/ // / / / Nienburger Str.1
/_//_/ /_/ FRG 30167 Hannover 1 email: knipp@ipi.uni-hannover.de
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: drawing vectors in polar stereo projection
Next Topic: HP-GL Problem

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:42:20 PDT 2025

Total time taken to generate the page: 0.00736 seconds