PANDORE Version 6 |
GREYC-IMAGE |
praw2pan
Converts raw image file to Pandore image file.
Synopsis
praw2pan bytes ncol nrow ndep color im_in [im_out|-]
Description
praw2pan converts a binary image to a Pandore image.
The parameter bytes determines the size of
each pixel in byte.
In the case of color images, if the parameter color=1
then the image is encoded by band, first all the pixels of the red band,
then the green bnad and finnaly the blue band.
If the parameter color=2 then the color
are encoded as a triplet (red, green, blue) for each pixel.
Caution: The raw image is
endian system dependent. Use the parameter bytes to specify
if the endian conversion must be done during the file conversion.
Tip: Because, the data are read from the end of the
file, this operator can be used to convert any
image type that encodes the image data in binary code.
Therefore, any header is skip.
Parameters
- bytes specifies the number of bytes for encoding a pixel.
By pure convention, a negative value indicates to exchange endian
encoding (LSB <->MSN).
This parameter also determines the output file format:
- bytes=1 (o -1) creates a Uchar image.
- bytes=2 (or -2) creates a Long image.
- bytes=3 (or -3) creates a Long image.
- bytes=4 (or -4) creates a Long image.
- bytes=6 (or -6) creates a Float image (pure convention).
- ncol, nrow nd ndep specify respectively
the number of columns, rows and plane of the image.
If ndep=0 then the image is a 2D image,
and if nrow=0 then the image is a 1D image.
- color : if color=0 then it is a grayscale image.
If color = 1 then the color image is encoding band per band
(first the red band then the green band and the blue band).
If color = 2 then the color images are encoding with
r,g,b values for each pixels, otherwise the color images.
Inputs
- im_in: a regular binary image file.
Outputs
- im_out: a Pandore image file.
Result
Returns SUCCESS or FAILURE.
Examples
Conversion of a 2D color image of size 1024x1024 pixels
encoded by bands.
praw2pan 1 1024 1024 0 0 image.raw image.pan
See also
Conversion,
ppan2raw
C++ prototype
Errc PRaw2Pan( const char* filename, pobject** obj_out, Long npix, Long nlig, Long ncol, int color );
Version française
Conversion d'un fichier image sans entête en un fichier Pandore.
Author: Regis Clouard