19 subroutine pngunpack(cpack, len, idrstmpl, ndpts, fld)
22 character(len = 1),
intent(in) :: cpack(len)
23 integer,
intent(in) :: ndpts, len
24 integer,
intent(in) :: idrstmpl(*)
25 real,
intent(out) :: fld(ndpts)
27 integer :: ifld(ndpts)
28 character(len = 1),
allocatable :: ctemp(:)
30 real :: ref, bscale, dscale
31 integer :: width, height
32 integer :: iret, itype, j, nbits
35 function dec_png(pngbuf, width, height, cout)
bind(c, name="dec_png")
37 character(kind = c_char),
intent(in) :: pngbuf(*)
38 integer(c_int),
intent(in) :: width, height
39 character(kind = c_char),
intent(out) :: cout(*)
40 integer(c_int) :: dec_png
46 bscale = 2.0**real(idrstmpl(2))
47 dscale = 10.0**real(-idrstmpl(3))
53 if (nbits .ne. 0)
then
54 allocate(ctemp(ndpts * 4))
55 iret =
dec_png(cpack, width, height, ctemp)
56 call g2_gbytesc(ctemp, ifld, 0, nbits, 0, ndpts)
59 fld(j) = ((real(ifld(j)) * bscale) + ref) * dscale
int dec_png(unsigned char *pngbuf, g2int *width, g2int *height, char *cout)
Decode some PNG compressed data.
subroutine g2_gbytesc(in, iout, iskip, nbits, nskip, n)
Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked a...
subroutine pngunpack(cpack, len, idrstmpl, ndpts, fld)
Unpack a data field packed into a PNG image format.
subroutine rdieee(rieee, a, num)
Copy array of 32-bit IEEE floating point values to local floating point representation.