Alien-FreeImage

 view release on metacpan or  search on metacpan

src/Source/FreeImage/PluginICO.cpp  view on Meta::CPAN

			icon_list[k].bWidth			= (bmih->biWidth > 255)  ? 0 : (BYTE)bmih->biWidth;
			icon_list[k].bHeight		= (bmih->biHeight > 255) ? 0 : (BYTE)bmih->biHeight;
			icon_list[k].bReserved		= 0;
			icon_list[k].wPlanes		= bmih->biPlanes;
			icon_list[k].wBitCount		= bmih->biBitCount;
			if( (icon_list[k].wPlanes * icon_list[k].wBitCount) >= 8 ) {
				icon_list[k].bColorCount = 0;
			} else {
				icon_list[k].bColorCount = (BYTE)(1 << (icon_list[k].wPlanes * icon_list[k].wBitCount));
			}
			// initial guess (correct only for standard icons)
			icon_list[k].dwBytesInRes	= CalculateImageSize(icon_dib);
			icon_list[k].dwImageOffset = CalculateImageOffset(vPages, k);
		}

		// make a room for icon dir entries, until later update
		const long directory_start = io->tell_proc(handle);
		io->write_proc(icon_list, sizeof(ICONDIRENTRY) * icon_header->idCount, 1, handle);

		// write the image bits for each image
		

src/Source/FreeImage/PluginPNG.cpp  view on Meta::CPAN


			FIICCPROFILE *iccProfile = FreeImage_GetICCProfile(dib);
			if (iccProfile->size && iccProfile->data) {
				png_set_iCCP(png_ptr, info_ptr, "Embedded Profile", 0, (png_const_bytep)iccProfile->data, iccProfile->size);
			}

			// write metadata

			WriteMetadata(png_ptr, info_ptr, dib);

			// Optional gamma chunk is strongly suggested if you have any guess
			// as to the correct gamma of the image.
			// png_set_gAMA(png_ptr, info_ptr, gamma);

			// set the transparency table

			if (bIsTransparent) {
				png_set_tRNS(png_ptr, info_ptr, FreeImage_GetTransparencyTable(dib), FreeImage_GetTransparencyCount(dib), NULL);
			}

			// set the background color

src/Source/FreeImageToolkit/MultigridPoissonSolver.cpp  view on Meta::CPAN

				// downward stoke of the V
				for (jj = j; jj >= 1; jj--) {
					// pre-smoothing
					for (jpre = 0; jpre < NPRE; jpre++) {
						fmg_relaxation(IU[jj], IRHS[jj], nf);
					}
					fmg_residual(IRES[jj], IU[jj], IRHS[jj], nf);
					nf = nf/2 + 1;
					// restriction of the residual is the next r.h.s.
					fmg_restrict(IRHS[jj-1], IRES[jj], nf);				
					// zero for initial guess in next relaxation
					fmg_fillArrayWithZeros(IU[jj-1]);
				}
				// bottom of V: solve on coarsest grid
				fmg_solve(IU[0], IRHS[0]); 
				nf = 3; 
				// upward stroke of V.
				for (jj = 1; jj <= j; jj++) { 
					nf = 2*nf - 1;
					// use res for temporary storage inside addint
					fmg_addint(IU[jj], IU[jj-1], IRES[jj], nf);				

src/Source/LibJPEG/README  view on Meta::CPAN

it.  This software may be referred to only as "the Independent JPEG Group's
software".

We specifically permit and encourage the use of this software as the basis of
commercial products, provided that all warranty or liability claims are
assumed by the product vendor.


The Unix configuration script "configure" was produced with GNU Autoconf.
It is copyright by the Free Software Foundation but is freely distributable.
The same holds for its supporting scripts (config.guess, config.sub,
ltmain.sh).  Another support script, install-sh, is copyright by X Consortium
but is also freely distributable.

The IJG distribution formerly included code to read and write GIF files.
To avoid entanglement with the Unisys LZW patent (now expired), GIF reading
support has been removed altogether, and the GIF writer has been simplified
to produce "uncompressed GIFs".  This technique does not use the LZW
algorithm; the resulting GIF files are larger than usual, but are readable
by all standard GIF decoders.

src/Source/LibJPEG/cjpeg.c  view on Meta::CPAN

#ifdef NEED_SIGNAL_CATCHER
  enable_signal_catcher((j_common_ptr) &cinfo);
#endif

  /* Initialize JPEG parameters.
   * Much of this may be overridden later.
   * In particular, we don't yet know the input file's color space,
   * but we need to provide some value for jpeg_set_defaults() to work.
   */

  cinfo.in_color_space = JCS_RGB; /* arbitrary guess */
  jpeg_set_defaults(&cinfo);

  /* Scan command line to find file names.
   * It is convenient to use just one switch-parsing routine, but the switch
   * values read here are ignored; we will rescan the switches after opening
   * the input file.
   */

  file_index = parse_switches(&cinfo, argc, argv, 0, FALSE);

src/Source/LibJPEG/filelist.txt  view on Meta::CPAN

*.txt		Other documentation files.
*.1		Documentation in Unix man page format.
change.log	Version-to-version change highlights.
example.c	Sample code for calling JPEG library.

Configuration/installation files and programs (see install.txt for more info):

configure	Unix shell script to perform automatic configuration.
configure.ac	Source file for use with Autoconf to generate configure.
ltmain.sh	Support scripts for configure (from GNU libtool).
config.guess
config.sub
depcomp
missing
ar-lib
compile
install-sh	Install shell script for those Unix systems lacking one.
Makefile.in	Makefile input for configure.
Makefile.am	Source file for use with Automake to generate Makefile.in.
ckconfig.c	Program to generate jconfig.h on non-Unix systems.
jconfig.txt	Template for making jconfig.h by hand.

src/Source/LibJPEG/jdapimin.c  view on Meta::CPAN

/*
 * Set default decompression parameters.
 */

LOCAL(void)
default_decompress_parms (j_decompress_ptr cinfo)
{
  int cid0, cid1, cid2;

  /* Guess the input colorspace, and set output colorspace accordingly. */
  /* Note application may override our guesses. */
  switch (cinfo->num_components) {
  case 1:
    cinfo->jpeg_color_space = JCS_GRAYSCALE;
    cinfo->out_color_space = JCS_GRAYSCALE;
    break;
    
  case 3:
    cid0 = cinfo->comp_info[0].component_id;
    cid1 = cinfo->comp_info[1].component_id;
    cid2 = cinfo->comp_info[2].component_id;

    /* First try to guess from the component IDs */
    if      (cid0 == 0x01 && cid1 == 0x02 && cid2 == 0x03)
      cinfo->jpeg_color_space = JCS_YCbCr;
    else if (cid0 == 0x01 && cid1 == 0x22 && cid2 == 0x23)
      cinfo->jpeg_color_space = JCS_BG_YCC;
    else if (cid0 == 0x52 && cid1 == 0x47 && cid2 == 0x42)
      cinfo->jpeg_color_space = JCS_RGB;	/* ASCII 'R', 'G', 'B' */
    else if (cid0 == 0x72 && cid1 == 0x67 && cid2 == 0x62)
      cinfo->jpeg_color_space = JCS_BG_RGB;	/* ASCII 'r', 'g', 'b' */
    else if (cinfo->saw_JFIF_marker)
      cinfo->jpeg_color_space = JCS_YCbCr;	/* assume it's YCbCr */

src/Source/LibJPEG/jdapimin.c  view on Meta::CPAN

	break;
      default:
	WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
	cinfo->jpeg_color_space = JCS_YCbCr;	/* assume it's YCbCr */
	break;
      }
    } else {
      TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);
      cinfo->jpeg_color_space = JCS_YCbCr;	/* assume it's YCbCr */
    }
    /* Always guess RGB is proper output colorspace. */
    cinfo->out_color_space = JCS_RGB;
    break;
    
  case 4:
    if (cinfo->saw_Adobe_marker) {
      switch (cinfo->Adobe_transform) {
      case 0:
	cinfo->jpeg_color_space = JCS_CMYK;
	break;
      case 2:

src/Source/LibJPEG/libjpeg.txt  view on Meta::CPAN

J_COLOR_SPACE jpeg_color_space		Colorspace of image
boolean saw_JFIF_marker			TRUE if a JFIF APP0 marker was seen
  UINT8 JFIF_major_version		Version information from JFIF marker
  UINT8 JFIF_minor_version
  UINT8 density_unit			Resolution data from JFIF marker
  UINT16 X_density
  UINT16 Y_density
boolean saw_Adobe_marker		TRUE if an Adobe APP14 marker was seen
  UINT8 Adobe_transform			Color transform code from Adobe marker

The JPEG color space, unfortunately, is something of a guess since the JPEG
standard proper does not provide a way to record it.  In practice most files
adhere to the JFIF or Adobe conventions, and the decoder will recognize these
correctly.  See "Special color spaces", below, for more info.


The decompression parameters that determine the basic properties of the
returned image are:

J_COLOR_SPACE out_color_space
	Output color space.  jpeg_read_header() sets an appropriate default

src/Source/LibJPEG/libjpeg.txt  view on Meta::CPAN


When told that the color space is UNKNOWN, the library will default to using
luminance-quality compression parameters for all color components.  You may
well want to change these parameters.  See the source code for
jpeg_set_colorspace(), in jcparam.c, for details.

For decompression, the JPEG file's color space is given in jpeg_color_space,
and this is transformed to the output color space out_color_space.
jpeg_read_header's setting of jpeg_color_space can be relied on if the file
conforms to JFIF or Adobe conventions, but otherwise it is no better than a
guess.  If you know the JPEG file's color space for certain, you can override
jpeg_read_header's guess by setting jpeg_color_space.  jpeg_read_header also
selects a default output color space based on (its guess of) jpeg_color_space;
set out_color_space to override this.  Again, you must select a supported
transformation.  jdcolor.c currently supports
	YCbCr => RGB
	YCbCr => GRAYSCALE
	BG_YCC => RGB
	BG_YCC => GRAYSCALE
	RGB => GRAYSCALE
	GRAYSCALE => RGB
	YCCK => CMYK
as well as the null transforms.  (Since GRAYSCALE=>RGB is provided, an

src/Source/LibPNG/CHANGES  view on Meta::CPAN

    where the length has not been extended to a multiple of 4, and pngtest
    now intercepts all libpng errors, allowing the previously-introduced
    "--strict test" on no warnings to actually work.
  Improved ICC profile handling including cHRM chunk generation and fixed
    Cygwin+MSVC build errors. The ICC profile handling now includes more
    checking.  Several errors that caused rejection of the profile are now
    handled with a warning in such a way that the invalid profiles will be
    read by default in release (but not pre-RC) builds but will not be
    written by default.  The easy part of handling the cHRM chunk is written,
    where the ICC profile contains the required data.  The more difficult
    part plus guessing a gAMA value requires code to pass selected RGB values
    through the profile.

Version 1.6.0beta30 [October 24, 2012]
  Changed ICC profile matrix/vector types to not depend on array type rules.
    By the ANSI-C standard the new types should be identical to the previous
    versions, and all known versions of gcc tested with the previous versions
    except for GCC-4.2.1 work with this version.  The change makes the ANSI-C
    rule that const applied to an array of elements applies instead to the
    elements in the array moot by explicitly applying const to the base
    elements of the png_icc_matrix and png_icc_vector types. The accidental

src/Source/LibPNG/INSTALL  view on Meta::CPAN

Your directory structure should look like this:

   ..       (the parent directory)
      libpng  (this directory)
          INSTALL (this file)
          README
          *.h, *.c  => libpng source files
          CMakeLists.txt    =>  "cmake" script
          configuration files:
             configure.ac, configure, Makefile.am, Makefile.in,
             autogen.sh, config.guess, ltmain.sh, missing, libpng.pc.in,
             libpng-config.in, aclocal.m4, config.h.in, config.sub,
             depcomp, install-sh, mkinstalldirs, test-pngtest.sh
          contrib
             arm-neon, conftest, examples, gregbook, libtests, pngminim,
             pngminus, pngsuite, tools, visupng
          projects
             cbuilder5, owatcom, visualc71, vstudio, xcode
          scripts
             makefile.*
             *.def (module definition files)

src/Source/LibPNG/example.c  view on Meta::CPAN

      screen_gamma = user-defined screen_gamma;
   }
   /* This is one way that applications share the same screen gamma value */
   else if ((gamma_str = getenv("SCREEN_GAMMA")) != NULL)
   {
      screen_gamma = atof(gamma_str);
   }
   /* If we don't have another value */
   else
   {
      screen_gamma = PNG_DEFAULT_sRGB;  /* A good guess for a PC monitor
                                           in a dimly lit room */
      screen_gamma = PNG_GAMMA_MAC_18 or 1.0; /* Good guesses for Mac systems */
   }

   /* Tell libpng to handle the gamma conversion for you.  The final call
    * is a good guess for PC generated images, but it should be configurable
    * by the user at run time by the user.  It is strongly suggested that
    * your application support gamma correction.
    */

   int intent;

   if (png_get_sRGB(png_ptr, info_ptr, &intent) != 0)
      png_set_gamma(png_ptr, screen_gamma, PNG_DEFAULT_sRGB);
   else
   {

src/Source/LibPNG/example.c  view on Meta::CPAN

   sig_bit.red = true_red_bit_depth;
   sig_bit.green = true_green_bit_depth;
   sig_bit.blue = true_blue_bit_depth;

   /* If the image has an alpha channel then */
   sig_bit.alpha = true_alpha_bit_depth;

   png_set_sBIT(png_ptr, info_ptr, &sig_bit);


   /* Optional gamma chunk is strongly suggested if you have any guess
    * as to the correct gamma of the image.
    */
   png_set_gAMA(png_ptr, info_ptr, gamma);

   /* Optionally write comments into the image */
   {
      png_text text_ptr[3];

      char key0[]="Title";
      char text0[]="Mona Lisa";

src/Source/LibPNG/pngrtran.c  view on Meta::CPAN

         {
            png_ptr->index_to_palette[i] = (png_byte)i;
            png_ptr->palette_to_index[i] = (png_byte)i;
         }

         hash = (png_dsortpp)png_calloc(png_ptr, (png_uint_32)(769 *
             (sizeof (png_dsortp))));

         num_new_palette = num_palette;

         /* Initial wild guess at how far apart the farthest pixel
          * pair we will be eliminating will be.  Larger
          * numbers mean more areas will be allocated, Smaller
          * numbers run the risk of not saving enough data, and
          * having to do this all over again.
          *
          * I have not done extensive checking on this number.
          */
         max_d = 96;

         while (num_new_palette > maximum_colors)

src/Source/LibPNG/pngrtran.c  view on Meta::CPAN

      while (sp < ep)
      {
         /* The input is an array of 16 bit components, these must be scaled to
          * 8 bits each.  For a 16 bit value V the required value (from the PNG
          * specification) is:
          *
          *    (V * 255) / 65535
          *
          * This reduces to round(V / 257), or floor((V + 128.5)/257)
          *
          * Represent V as the two byte value vhi.vlo.  Make a guess that the
          * result is the top byte of V, vhi, then the correction to this value
          * is:
          *
          *    error = floor(((V-vhi.vhi) + 128.5) / 257)
          *          = floor(((vlo-vhi) + 128.5) / 257)
          *
          * This can be approximated using integer arithmetic (and a signed
          * shift):
          *
          *    error = (vlo-vhi+128) >> 8;

src/Source/LibPNG/pngrutil.c  view on Meta::CPAN

}

/* Optionally skip data and then check the CRC.  Depending on whether we
 * are reading an ancillary or critical chunk, and how the program has set
 * things up, we may calculate the CRC on the data and print a message.
 * Returns '1' if there was a CRC error, '0' otherwise.
 */
int /* PRIVATE */
png_crc_finish(png_structrp png_ptr, png_uint_32 skip)
{
   /* The size of the local buffer for inflate is a good guess as to a
    * reasonable size to use for buffering reads from the application.
    */
   while (skip > 0)
   {
      png_uint_32 len;
      png_byte tmpbuf[PNG_INFLATE_BUF_SIZE];

      len = (sizeof tmpbuf);
      if (len > skip)
         len = skip;

src/Source/LibRawLite/dcraw/dcraw.c  view on Meta::CPAN

  free (brow[4]);
  free (code[0][0]);
}

/*
   Patterned Pixel Grouping Interpolation by Alain Desbiolles
*/
void CLASS ppg_interpolate()
{
  int dir[5] = { 1, width, -1, -width, 1 };
  int row, col, diff[2], guess[2], c, d, i;
  ushort (*pix)[4];

  border_interpolate(3);
#ifdef DCRAW_VERBOSE
  if (verbose) fprintf (stderr,_("PPG interpolation...\n"));
#endif

/*  Fill in the green layer with gradients and pattern recognition: */
#ifdef LIBRAW_LIBRARY_BUILD
  RUN_CALLBACK(LIBRAW_PROGRESS_INTERPOLATE,0,3);
#ifdef LIBRAW_USE_OPENMP
#pragma omp parallel for default(shared) private(guess, diff, row, col, d, c, i, pix) schedule(static)
#endif
#endif
  for (row=3; row < height-3; row++)
    for (col=3+(FC(row,3) & 1), c=FC(row,col); col < width-3; col+=2) {
      pix = image + row*width+col;
      for (i=0; (d=dir[i]) > 0; i++) {
	guess[i] = (pix[-d][1] + pix[0][c] + pix[d][1]) * 2
		      - pix[-2*d][c] - pix[2*d][c];
	diff[i] = ( ABS(pix[-2*d][c] - pix[ 0][c]) +
		    ABS(pix[ 2*d][c] - pix[ 0][c]) +
		    ABS(pix[  -d][1] - pix[ d][1]) ) * 3 +
		  ( ABS(pix[ 3*d][1] - pix[ d][1]) +
		    ABS(pix[-3*d][1] - pix[-d][1]) ) * 2;
      }
      d = dir[i = diff[0] > diff[1]];
      pix[0][1] = ULIM(guess[i] >> 2, pix[d][1], pix[-d][1]);
    }
/*  Calculate red and blue for each green pixel:		*/
#ifdef LIBRAW_LIBRARY_BUILD
  RUN_CALLBACK(LIBRAW_PROGRESS_INTERPOLATE,1,3);
#ifdef LIBRAW_USE_OPENMP
#pragma omp parallel for default(shared) private(guess, diff, row, col, d, c, i, pix) schedule(static)
#endif
#endif
  for (row=1; row < height-1; row++)
    for (col=1+(FC(row,2) & 1), c=FC(row,col+1); col < width-1; col+=2) {
      pix = image + row*width+col;
      for (i=0; (d=dir[i]) > 0; c=2-c, i++)
	pix[0][c] = CLIP((pix[-d][c] + pix[d][c] + 2*pix[0][1]
			- pix[-d][1] - pix[d][1]) >> 1);
    }
/*  Calculate blue for red pixels and vice versa:		*/
#ifdef LIBRAW_LIBRARY_BUILD
  RUN_CALLBACK(LIBRAW_PROGRESS_INTERPOLATE,2,3);
#ifdef LIBRAW_USE_OPENMP
#pragma omp parallel for default(shared) private(guess, diff, row, col, d, c, i, pix) schedule(static)
#endif
#endif
  for (row=1; row < height-1; row++)
    for (col=1+(FC(row,1) & 1), c=2-FC(row,col); col < width-1; col+=2) {
      pix = image + row*width+col;
      for (i=0; (d=dir[i]+dir[i+1]) > 0; i++) {
	diff[i] = ABS(pix[-d][c] - pix[d][c]) +
		  ABS(pix[-d][1] - pix[0][1]) +
		  ABS(pix[ d][1] - pix[0][1]);
	guess[i] = pix[-d][c] + pix[d][c] + 2*pix[0][1]
		 - pix[-d][1] - pix[d][1];
      }
      if (diff[0] != diff[1])
	pix[0][c] = CLIP(guess[diff[0] > diff[1]] >> 1);
      else
	pix[0][c] = CLIP((guess[0]+guess[1]) >> 2);
    }
}

void CLASS cielab (ushort rgb[3], short lab[3])
{
  int c, i, j, k;
  float r, xyz[3];
#ifdef LIBRAW_NOTHREADS
  static float cbrt[0x10000], xyz_cam[3][4];
#else

src/Source/LibRawLite/dcraw/dcraw.c  view on Meta::CPAN

        else
          {
            if ((plen=len) > 16) plen = 16;
            fread (cfa_pat, 1, plen, ifp);
            for (colors=cfa=i=0; i < plen && colors < 4; i++) {
              colors += !(cfa & (1 << cfa_pat[i]));
              cfa |= 1 << cfa_pat[i];
            }
            if (cfa == 070) memcpy (cfa_pc,"\003\004\005",3);	/* CMY */
            if (cfa == 072) memcpy (cfa_pc,"\005\003\004\001",4);	/* GMCY */
            goto guess_cfa_pc;
          }
        break;
      case 33424:
      case 65024:
	fseek (ifp, get4()+base, SEEK_SET);
	parse_kodak_ifd (base);
	break;
      case 33434:			/* ExposureTime */
	shutter = getreal(type);
	break;

src/Source/LibRawLite/dcraw/dcraw.c  view on Meta::CPAN

      case 50706:			/* DNGVersion */
	FORC4 dng_version = (dng_version << 8) + fgetc(ifp);
	if (!make[0]) strcpy (make, "DNG");
	is_raw = 1;
	break;
      case 50710:			/* CFAPlaneColor */
	if (filters == 9) break;
	if (len > 4) len = 4;
	colors = len;
	fread (cfa_pc, 1, colors, ifp);
guess_cfa_pc:
        FORCC tab[cfa_pc[c]] = c;
        cdesc[c] = 0;
        for (i=16; i--; )
          filters = filters << 2 | tab[cfa_pat[i % plen]];
        filters -= !filters;
	break;
      case 50711:			/* CFALayout */
	if (get2() == 2) {
	  fuji_width = 1;
	  filters = 0x49494949;

src/Source/LibRawLite/dcraw/dcraw.c  view on Meta::CPAN

  { -1.936280,  1.800443, -1.448486,  2.584324,
     1.405365, -0.524955, -0.289090,  0.408680,
    -1.204965,  1.082304,  2.941367, -1.818705 }
  };
  int i, c;

  for (raw_color = i=0; i < 3; i++)
    FORCC rgb_cam[i][c] = table[index][i*colors+c];
}

short CLASS guess_byte_order (int words)
{
  uchar test[4][2];
  int t=2, msb;
  double diff, sum[2] = {0,0};

  fread (test[0], 2, 2, ifp);
  for (words-=2; words--; ) {
    fread (test[t], 2, 1, ifp);
    for (msb=0; msb < 2; msb++) {
      diff = (test[t^2][msb] << 8 | test[t^2][!msb])

src/Source/LibRawLite/dcraw/dcraw.c  view on Meta::CPAN

      if (i < 0) filters = 0x61616161;
    }
  } else if (fsize == 5869568) {
    if (!timestamp && minolta_z2()) {
      strcpy (make, "Minolta");
      strcpy (model,"DiMAGE Z2");
    }
    load_flags = 6 + 24*(make[0] == 'M');
  } else if (fsize == 6291456) {
    fseek (ifp, 0x300000, SEEK_SET);
    if ((order = guess_byte_order(0x10000)) == 0x4d4d) {
      height -= (top_margin = 16);
      width -= (left_margin = 28);
      maximum = 0xf5c0;
      strcpy (make, "ISG");
      model[0] = 0;
    }
  } else if (!strcmp(make,"Fujifilm")) {
    if (!strcmp(model+7,"S2Pro")) {
      strcpy (model,"S2Pro");
      height = 2144;

src/Source/LibRawLite/internal/dcraw_common.cpp  view on Meta::CPAN

  free (brow[4]);
  free (code[0][0]);
}

/*
   Patterned Pixel Grouping Interpolation by Alain Desbiolles
*/
void CLASS ppg_interpolate()
{
  int dir[5] = { 1, width, -1, -width, 1 };
  int row, col, diff[2], guess[2], c, d, i;
  ushort (*pix)[4];

  border_interpolate(3);
#ifdef DCRAW_VERBOSE
  if (verbose) fprintf (stderr,_("PPG interpolation...\n"));
#endif

/*  Fill in the green layer with gradients and pattern recognition: */
#ifdef LIBRAW_LIBRARY_BUILD
  RUN_CALLBACK(LIBRAW_PROGRESS_INTERPOLATE,0,3);
#ifdef LIBRAW_USE_OPENMP
#pragma omp parallel for default(shared) private(guess, diff, row, col, d, c, i, pix) schedule(static)
#endif
#endif
  for (row=3; row < height-3; row++)
    for (col=3+(FC(row,3) & 1), c=FC(row,col); col < width-3; col+=2) {
      pix = image + row*width+col;
      for (i=0; (d=dir[i]) > 0; i++) {
	guess[i] = (pix[-d][1] + pix[0][c] + pix[d][1]) * 2
		      - pix[-2*d][c] - pix[2*d][c];
	diff[i] = ( ABS(pix[-2*d][c] - pix[ 0][c]) +
		    ABS(pix[ 2*d][c] - pix[ 0][c]) +
		    ABS(pix[  -d][1] - pix[ d][1]) ) * 3 +
		  ( ABS(pix[ 3*d][1] - pix[ d][1]) +
		    ABS(pix[-3*d][1] - pix[-d][1]) ) * 2;
      }
      d = dir[i = diff[0] > diff[1]];
      pix[0][1] = ULIM(guess[i] >> 2, pix[d][1], pix[-d][1]);
    }
/*  Calculate red and blue for each green pixel:		*/
#ifdef LIBRAW_LIBRARY_BUILD
  RUN_CALLBACK(LIBRAW_PROGRESS_INTERPOLATE,1,3);
#ifdef LIBRAW_USE_OPENMP
#pragma omp parallel for default(shared) private(guess, diff, row, col, d, c, i, pix) schedule(static)
#endif
#endif
  for (row=1; row < height-1; row++)
    for (col=1+(FC(row,2) & 1), c=FC(row,col+1); col < width-1; col+=2) {
      pix = image + row*width+col;
      for (i=0; (d=dir[i]) > 0; c=2-c, i++)
	pix[0][c] = CLIP((pix[-d][c] + pix[d][c] + 2*pix[0][1]
			- pix[-d][1] - pix[d][1]) >> 1);
    }
/*  Calculate blue for red pixels and vice versa:		*/
#ifdef LIBRAW_LIBRARY_BUILD
  RUN_CALLBACK(LIBRAW_PROGRESS_INTERPOLATE,2,3);
#ifdef LIBRAW_USE_OPENMP
#pragma omp parallel for default(shared) private(guess, diff, row, col, d, c, i, pix) schedule(static)
#endif
#endif
  for (row=1; row < height-1; row++)
    for (col=1+(FC(row,1) & 1), c=2-FC(row,col); col < width-1; col+=2) {
      pix = image + row*width+col;
      for (i=0; (d=dir[i]+dir[i+1]) > 0; i++) {
	diff[i] = ABS(pix[-d][c] - pix[d][c]) +
		  ABS(pix[-d][1] - pix[0][1]) +
		  ABS(pix[ d][1] - pix[0][1]);
	guess[i] = pix[-d][c] + pix[d][c] + 2*pix[0][1]
		 - pix[-d][1] - pix[d][1];
      }
      if (diff[0] != diff[1])
	pix[0][c] = CLIP(guess[diff[0] > diff[1]] >> 1);
      else
	pix[0][c] = CLIP((guess[0]+guess[1]) >> 2);
    }
}

void CLASS cielab (ushort rgb[3], short lab[3])
{
  int c, i, j, k;
  float r, xyz[3];
#ifdef LIBRAW_NOTHREADS
  static float cbrt[0x10000], xyz_cam[3][4];
#else

src/Source/LibRawLite/internal/dcraw_common.cpp  view on Meta::CPAN

        else
          {
            if ((plen=len) > 16) plen = 16;
            fread (cfa_pat, 1, plen, ifp);
            for (colors=cfa=i=0; i < plen && colors < 4; i++) {
              colors += !(cfa & (1 << cfa_pat[i]));
              cfa |= 1 << cfa_pat[i];
            }
            if (cfa == 070) memcpy (cfa_pc,"\003\004\005",3);	/* CMY */
            if (cfa == 072) memcpy (cfa_pc,"\005\003\004\001",4);	/* GMCY */
            goto guess_cfa_pc;
          }
        break;
      case 33424:
      case 65024:
	fseek (ifp, get4()+base, SEEK_SET);
	parse_kodak_ifd (base);
	break;
      case 33434:			/* ExposureTime */
	shutter = getreal(type);
	break;

src/Source/LibRawLite/internal/dcraw_common.cpp  view on Meta::CPAN

      case 50706:			/* DNGVersion */
	FORC4 dng_version = (dng_version << 8) + fgetc(ifp);
	if (!make[0]) strcpy (make, "DNG");
	is_raw = 1;
	break;
      case 50710:			/* CFAPlaneColor */
	if (filters == 9) break;
	if (len > 4) len = 4;
	colors = len;
	fread (cfa_pc, 1, colors, ifp);
guess_cfa_pc:
        FORCC tab[cfa_pc[c]] = c;
        cdesc[c] = 0;
        for (i=16; i--; )
          filters = filters << 2 | tab[cfa_pat[i % plen]];
        filters -= !filters;
	break;
      case 50711:			/* CFALayout */
	if (get2() == 2) {
	  fuji_width = 1;
	  filters = 0x49494949;

src/Source/LibRawLite/internal/dcraw_common.cpp  view on Meta::CPAN

  { -1.936280,  1.800443, -1.448486,  2.584324,
     1.405365, -0.524955, -0.289090,  0.408680,
    -1.204965,  1.082304,  2.941367, -1.818705 }
  };
  int i, c;

  for (raw_color = i=0; i < 3; i++)
    FORCC rgb_cam[i][c] = table[index][i*colors+c];
}

short CLASS guess_byte_order (int words)
{
  uchar test[4][2];
  int t=2, msb;
  double diff, sum[2] = {0,0};

  fread (test[0], 2, 2, ifp);
  for (words-=2; words--; ) {
    fread (test[t], 2, 1, ifp);
    for (msb=0; msb < 2; msb++) {
      diff = (test[t^2][msb] << 8 | test[t^2][!msb])

src/Source/LibRawLite/internal/dcraw_common.cpp  view on Meta::CPAN

      if (i < 0) filters = 0x61616161;
    }
  } else if (fsize == 5869568) {
    if (!timestamp && minolta_z2()) {
      strcpy (make, "Minolta");
      strcpy (model,"DiMAGE Z2");
    }
    load_flags = 6 + 24*(make[0] == 'M');
  } else if (fsize == 6291456) {
    fseek (ifp, 0x300000, SEEK_SET);
    if ((order = guess_byte_order(0x10000)) == 0x4d4d) {
      height -= (top_margin = 16);
      width -= (left_margin = 28);
      maximum = 0xf5c0;
      strcpy (make, "ISG");
      model[0] = 0;
    }
  } else if (!strcmp(make,"Fujifilm")) {
    if (!strcmp(model+7,"S2Pro")) {
      strcpy (model,"S2Pro");
      height = 2144;

src/Source/LibRawLite/internal/libraw_internal_funcs.h  view on Meta::CPAN

		void        parse_gps_libraw(int base);
		void        romm_coeff(float romm_cam[3][3]);
    void        parse_mos (int offset);
    void        parse_qt (int end);
    void        get_timestamp (int reversed);

// External JPEGs, what cameras uses it ?
    void        parse_external_jpeg();

// The identify
    short       guess_byte_order (int words);

// Tiff writer
    void        tiff_set (ushort *ntag, ushort tag, ushort type, int count, int val);
    void        tiff_head (struct tiff_hdr *th, int full);

// splitted AHD code
#define TS 512
    void        ahd_interpolate_green_h_and_v(int top, int left, ushort (*out_rgb)[TS][TS][3]);
    void ahd_interpolate_r_and_b_in_rgb_and_convert_to_cielab(int top, int left, ushort (*inout_rgb)[TS][3], short (*out_lab)[TS][3]);
    void ahd_interpolate_r_and_b_and_convert_to_cielab(int top, int left, ushort (*inout_rgb)[TS][TS][3], short (*out_lab)[TS][TS][3]);

src/Source/LibTIFF4/ChangeLog  view on Meta::CPAN


	http://bugzilla.remotesensing.org/show_bug.cgi?id=764

	* tools/tiffcmp.c: Use properly sized buffer in short arrays comparison
	as per bug

	http://bugzilla.remotesensing.org/show_bug.cgi?id=785

2005-03-03  Andrey Kiselev  <dron@ak4719.spb.edu>

	* libtiff/tif_dirread.c: More logic to guess missed strip size as per
	bug http://bugzilla.remotesensing.org/show_bug.cgi?id=705

	* tools/fax2ps.c: Replace insecure mktemp() function with the
	tmpfile() as per bug

	http://bugzilla.remotesensing.org/show_bug.cgi?id=786

2005-02-04  Andrey Kiselev  <dron@ak4719.spb.edu>

	* libtiff/tiff.h: Changed the int8 definition to be always signed char

src/Source/LibTIFF4/ChangeLog  view on Meta::CPAN


	* libtiff/{tiff.h, tif_fax3.c}:Fixes for AMD 64 platform as
	suggested by Jeremy C. Reed.

2003-12-26  Andrey Kiselev  <dron@ak4719.spb.edu>

	* libtiff 3.6.1 released.

2003-12-24  Andrey Kiselev  <dron@ak4719.spb.edu>

	* config.guess, config.sub: Updated from the recent upstream.

2003-12-22  Andrey Kiselev  <dron@ak4719.spb.edu>

	* libtiff/{tif_color, tif_getimage.c, tiffio.h}, man/TIFFcolor.3t:
	More cleanups in color conversion interface, added appropriate manual
	page.

2003-12-19  Andrey Kiselev  <dron@ak4719.spb.edu>

	* libtiff/{tif_extension.c, tif_dirinfo.c, tiff.h}: Warnings fixed as

src/Source/LibTIFF4/ChangeLog  view on Meta::CPAN


	* tools/{ras2tiff.c, rasterfile.h}: Properly determine SUN Rasterfiles
	with the reverse byte order (it is reported by the magic header
	field). Problem reported by Andreas Wiesmann.

	* tools/raw2tiff.c, man/raw2tiff.1: Few improvements in correlation
	calculation function. Guessing mechanics now documented in manual page.

2003-11-11  Andrey Kiselev  <dron@ak4719.spb.edu>

	* tools/raw2tiff.c: Implemented image size guessing using
	correlation coefficient calculation between two neighbour lines.

2003-11-09  Frank Warmerdam  <warmerdam@pobox.com>

	* libtiff/tif_tile.c: remove spurious use of "s" (sample) in the
	planarconfig_contig case in TIFFComputeTile().

	http://bugzilla.remotesensing.org/show_bug.cgi?id=387

2003-11-09  Andrey Kiselev  <dron@ak4719.spb.edu>

src/Source/LibTIFF4/ChangeLog  view on Meta::CPAN

	a pre-existing compressed image.  That is, image writing to
	pre-existing compressed images is not allowed.

	* libtiff/tif_open.c: Removed error if opening a compressed file
	in update mode.

	http://bugzilla.remotesensing.org/show_bug.cgi?id=198

2003-01-31  Andrey Kiselev  <dron@ak4719.spb.edu>

	* config.guess, config.sub: Updated to recent upstream versions.

2003-01-15  Frank Warmerdam  <warmerdam@pobox.com>

	* cut 3.6.0 Beta release.

2002-12-20  Andrey Kiselev  <dron@ak4719.spb.edu>

	* tools/fax2ps.c, man/fax2ps.1: Page size was determined
	in wrong way as per bug

src/Source/LibTIFF4/ChangeLog  view on Meta::CPAN


	* config.site/configure: added support for OJPEG=yes option to enable
	OJPEG support from config.site.

2002-01-27  Frank Warmerdam  <warmerdam@pobox.com>

	* html/document.html: fixed links for TIFf 6 docs.

2002-01-18  Frank Warmerdam  <warmerdam@pobox.com>

	* config.guess, config.sub: Updated from ftp.gnu.org/pub/config.

	* libtiff/tif_read.c: Fixed TIFFReadEncodedStrip() to fail if the
	decodestrip function returns anything not greater than zero as per
	http://bugzilla.remotesensing.org/show_bug.cgi?id=97

	* configure: Modify CheckForBigEndian so it can work in a cross
	compiled situation.

2002-01-16  Frank Warmerdam  <warmerdam@pobox.com>

src/Source/LibTIFF4/ChangeLog  view on Meta::CPAN

	bug report http://bugzilla.remotesensing.org/show_bug.cgi?id=44

2001-04-05  Frank Warmerdam  <warmerdam@pobox.com>

	* tiffio.h: removed C++ style comment.

	* configure: fixed up SCRIPT_SH/SHELL handling.

	* Makefile.in: Fixed SCRIPT_SH/SHELL handling.

	* config.guess: documented more variables as per bug 40.

2001-04-03  Frank Warmerdam  <warmerdam@pobox.com>

	* configure, *Makefile.in: Various changes to improve configuration
	for HP/UX specifically, and also in general.  They include:
	 - Try to handle /usr/bin/sh instead of /bin/sh where necessary.
	 - Upgrade to HP/UX 10.x+ compiler, linker and dso options.
	 - Fixed mmap() test to avoid MMAP_FIXED ... it isn't available on HP
	 - Use -${MAKEFLAGS} in sub makes from makefiles.

src/Source/LibTIFF4/ChangeLog  view on Meta::CPAN

	* libtiff/tiff.h: Applied hac to try and resolve the problem
	with the inttypes.h include file on AIX.

	See http://bugzilla.remotesensing.org/show_bug.cgi?id=39

	* VERSION: update to 3.5.7 beta in preparation for release.

	* configure/config.site: modified to check if -lm is needed for
	MACHDEPLIBS if not supplied by config.site.  Needed for Darwin.

	* config.guess: updated wholesale to an FSF version apparently
	from 1998 (as opposed to 1994).  This is mainly inspired by
	providing for MacOS X support.

2001-03-29  Frank Warmerdam  <warmerdam@pobox.com>

	* configure, Makefile.in, etc: added support for OPTIMIZER being
	set from config.site.

2001-03-28  Frank Warmerdam  <warmerdam@pobox.com>

src/Source/LibTIFF4/tif_luv.c  view on Meta::CPAN

	    (sp->tbuf = (uint8*) _TIFFmalloc(sp->tbuflen * sizeof (int16))) == NULL) {
		TIFFErrorExt(tif->tif_clientdata, module, "No space for SGILog translation buffer");
		return (0);
	}
	return (1);
}

static int
LogLuvGuessDataFmt(TIFFDirectory *td)
{
	int guess;

	/*
	 * If the user didn't tell us their datafmt,
	 * take our best guess from the bitspersample.
	 */
#define	PACK(a,b)	(((a)<<3)|(b))
	switch (PACK(td->td_bitspersample, td->td_sampleformat)) {
	case PACK(32, SAMPLEFORMAT_IEEEFP):
		guess = SGILOGDATAFMT_FLOAT;
		break;
	case PACK(32, SAMPLEFORMAT_VOID):
	case PACK(32, SAMPLEFORMAT_UINT):
	case PACK(32, SAMPLEFORMAT_INT):
		guess = SGILOGDATAFMT_RAW;
		break;
	case PACK(16, SAMPLEFORMAT_VOID):
	case PACK(16, SAMPLEFORMAT_INT):
	case PACK(16, SAMPLEFORMAT_UINT):
		guess = SGILOGDATAFMT_16BIT;
		break;
	case PACK( 8, SAMPLEFORMAT_VOID):
	case PACK( 8, SAMPLEFORMAT_UINT):
		guess = SGILOGDATAFMT_8BIT;
		break;
	default:
		guess = SGILOGDATAFMT_UNKNOWN;
		break;
#undef PACK
	}
	/*
	 * Double-check samples per pixel.
	 */
	switch (td->td_samplesperpixel) {
	case 1:
		if (guess != SGILOGDATAFMT_RAW)
			guess = SGILOGDATAFMT_UNKNOWN;
		break;
	case 3:
		if (guess == SGILOGDATAFMT_RAW)
			guess = SGILOGDATAFMT_UNKNOWN;
		break;
	default:
		guess = SGILOGDATAFMT_UNKNOWN;
		break;
	}
	return (guess);
}

static int
LogLuvInitState(TIFF* tif)
{
	static const char module[] = "LogLuvInitState";
	TIFFDirectory* td = &tif->tif_dir;
	LogLuvState* sp = DecoderState(tif);

	assert(sp != NULL);

src/Source/LibTIFF4/tif_pixarlog.c  view on Meta::CPAN

#define EncoderState(tif)	((PixarLogState*) (tif)->tif_data)

static int PixarLogEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s);
static int PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s);

#define PIXARLOGDATAFMT_UNKNOWN	-1

static int
PixarLogGuessDataFmt(TIFFDirectory *td)
{
	int guess = PIXARLOGDATAFMT_UNKNOWN;
	int format = td->td_sampleformat;

	/* If the user didn't tell us his datafmt,
	 * take our best guess from the bitspersample.
	 */
	switch (td->td_bitspersample) {
	 case 32:
		if (format == SAMPLEFORMAT_IEEEFP)
			guess = PIXARLOGDATAFMT_FLOAT;
		break;
	 case 16:
		if (format == SAMPLEFORMAT_VOID || format == SAMPLEFORMAT_UINT)
			guess = PIXARLOGDATAFMT_16BIT;
		break;
	 case 12:
		if (format == SAMPLEFORMAT_VOID || format == SAMPLEFORMAT_INT)
			guess = PIXARLOGDATAFMT_12BITPICIO;
		break;
	 case 11:
		if (format == SAMPLEFORMAT_VOID || format == SAMPLEFORMAT_UINT)
			guess = PIXARLOGDATAFMT_11BITLOG;
		break;
	 case 8:
		if (format == SAMPLEFORMAT_VOID || format == SAMPLEFORMAT_UINT)
			guess = PIXARLOGDATAFMT_8BIT;
		break;
	}

	return guess;
}

static tmsize_t
multiply_ms(tmsize_t m1, tmsize_t m2)
{
	tmsize_t bytes = m1 * m2;

	if (m1 && bytes / m1 != m2)
		bytes = 0;

src/Source/LibTIFF4/tif_zip.c  view on Meta::CPAN

 * directory ftp://ftp.uu.net/pub/archiving/zip/doc.  The library was
 * last found at ftp://ftp.uu.net/pub/archiving/zip/zlib/zlib-0.99.tar.gz.
 */
#include "tif_predict.h"
#include "../ZLib/zlib.h"

#include <stdio.h>

/*
 * Sigh, ZLIB_VERSION is defined as a string so there's no
 * way to do a proper check here.  Instead we guess based
 * on the presence of #defines that were added between the
 * 0.95 and 1.0 distributions.
 */
#if !defined(Z_NO_COMPRESSION) || !defined(Z_DEFLATED)
#error "Antiquated ZLIB software; you must use version 1.0 or later"
#endif

#define SAFE_MSG(sp)   ((sp)->stream.msg == NULL ? "" : (sp)->stream.msg)

/*

src/Source/LibWebP/src/dec/dec.io.c  view on Meta::CPAN

  }
  return io->mb_h;
}
#endif

//------------------------------------------------------------------------------
// Fancy upsampling

#ifdef FANCY_UPSAMPLING
static int EmitFancyRGB(const VP8Io* const io, WebPDecParams* const p) {
  int num_lines_out = io->mb_h;   // a priori guess
  const WebPRGBABuffer* const buf = &p->output->u.RGBA;
  uint8_t* dst = buf->rgba + io->mb_y * buf->stride;
  WebPUpsampleLinePairFunc upsample = WebPUpsamplers[p->output->colorspace];
  const uint8_t* cur_y = io->y;
  const uint8_t* cur_u = io->u;
  const uint8_t* cur_v = io->v;
  const uint8_t* top_u = p->tmp_u;
  const uint8_t* top_v = p->tmp_v;
  int y = io->mb_y;
  const int y_end = io->mb_y + io->mb_h;

src/Source/LibWebP/src/enc/enc.backward_references.c  view on Meta::CPAN

    VP8LHistogramCreate(histo, refs_rle, *cache_bits);
    bit_cost_rle = VP8LHistogramEstimateBits(histo);
    // Decide if LZ77 is useful.
    lz77_is_useful = (bit_cost_lz77 < bit_cost_rle);
  }

  // Choose appropriate backward reference.
  if (lz77_is_useful) {
    // TraceBackwards is costly. Don't execute it at lower quality.
    const int try_lz77_trace_backwards = (quality >= 25);
    best = refs_lz77;   // default guess: lz77 is better
    if (try_lz77_trace_backwards) {
      VP8LBackwardRefs* const refs_trace = refs_rle;
      if (!VP8LBackwardRefsCopy(refs_lz77, refs_trace)) {
        best = NULL;
        goto Error;
      }
      if (BackwardReferencesTraceBackwards(width, height, argb, quality,
                                           *cache_bits, hash_chain,
                                           refs_trace)) {
        double bit_cost_trace;

src/Source/LibWebP/src/enc/vp8enci.h  view on Meta::CPAN

int VP8EncTokenLoop(VP8Encoder* const enc);

  // in webpenc.c
// Assign an error code to a picture. Return false for convenience.
int WebPEncodingSetError(const WebPPicture* const pic, WebPEncodingError error);
int WebPReportProgress(const WebPPicture* const pic,
                       int percent, int* const percent_store);

  // in analysis.c
// Main analysis loop. Decides the segmentations and complexity.
// Assigns a first guess for Intra16 and uvmode_ prediction modes.
int VP8EncAnalyze(VP8Encoder* const enc);

  // in quant.c
// Sets up segment's quantization values, base_quant_ and filter strengths.
void VP8SetSegmentParams(VP8Encoder* const enc, float quality);
// Pick best modes and fills the levels. Returns true if skipped.
int VP8Decimate(VP8EncIterator* const it, VP8ModeScore* const rd,
                VP8RDLevel rd_opt);

  // in alpha.c

src/Source/LibWebP/src/mux/mux.anim_encode.c  view on Meta::CPAN

  while (length-- > 0) {
    if (*src != *dst) {
      return 0;
    }
    src += src_step;
    dst += dst_step;
  }
  return 1;
}

// Assumes that an initial valid guess of change rectangle 'rect' is passed.
static void MinimizeChangeRectangle(const WebPPicture* const src,
                                    const WebPPicture* const dst,
                                    FrameRect* const rect) {
  int i, j;
  // Sanity checks.
  assert(src->width == dst->width && src->height == dst->height);
  assert(rect->x_offset_ + rect->width_ <= dst->width);
  assert(rect->y_offset_ + rect->height_ <= dst->height);

  // Left boundary.

src/Source/LibWebP/src/mux/mux.anim_encode.c  view on Meta::CPAN


// Snap rectangle to even offsets (and adjust dimensions if needed).
static WEBP_INLINE void SnapToEvenOffsets(FrameRect* const rect) {
  rect->width_ += (rect->x_offset_ & 1);
  rect->height_ += (rect->y_offset_ & 1);
  rect->x_offset_ &= ~1;
  rect->y_offset_ &= ~1;
}

// Given previous and current canvas, picks the optimal rectangle for the
// current frame. The initial guess for 'rect' will be the full canvas.
static int GetSubRect(const WebPPicture* const prev_canvas,
                      const WebPPicture* const curr_canvas, int is_key_frame,
                      int is_first_frame, FrameRect* const rect,
                      WebPPicture* const sub_frame) {
  rect->x_offset_ = 0;
  rect->y_offset_ = 0;
  rect->width_ = curr_canvas->width;
  rect->height_ = curr_canvas->height;
  if (!is_key_frame || is_first_frame) {  // Optimize frame rectangle.
    // Note: This behaves as expected for first frame, as 'prev_canvas' is

src/Source/OpenEXR/Copyrights/openexr/ChangeLog  view on Meta::CPAN

	  DLLs, however, you must define OPENEXR_DLL in your
	  project's preprocessor directives.
	  (Drew Hess)
	* Many fixes to the Windows VC7 build system.
	  (Drew Hess, Nick Porcino)
	* Support for building universal binaries on OS X 10.4.
	  (Drew Hess, Paul Schneider)
	* Minor configure.ac fix to accomodate OS X's automake.
	  (Drew Hess)
	* Removed CPU-specific optimizations from configure.ac,
	  autoconf's guess at the CPU type isn't very useful,
	  anyway.  Closes #13429.
	  (Drew Hess)
	* Fixed quoting for tests in configure.ac.  Closes #13428.
	  (Drew Hess)
	* Use host specification instead of target in configure.ac.
	  Closes #13427.
	  (Drew Hess)
	* Fix use of AC_ARG_ENABLE in configure.ac.  Closes
	  #13426.
	  (Drew Hess)

src/Source/OpenEXR/IlmImf/ImfFramesPerSecond.cpp  view on Meta::CPAN


#include <ImfFramesPerSecond.h>
#include "ImathFun.h"

using namespace IMATH_NAMESPACE;
#include "ImfNamespace.h"

OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER

Rational
guessExactFps (double fps)
{
    return guessExactFps (Rational (fps));
}


Rational
guessExactFps (const Rational &fps)
{
    const double e = 0.002;

    if (abs (double (fps) - double (fps_23_976())) < e)
	return fps_23_976();

    if (abs (double (fps) - double (fps_29_97())) < e)
	return fps_29_97();

    if (abs (double (fps) - double (fps_47_952())) < e)

src/Source/OpenEXR/IlmImf/ImfFramesPerSecond.h  view on Meta::CPAN

//	    fps_47_952()	47.952047...
//	    fps_48()		48.0
//	    fps_50()		50.0		PAL video fields
//	    fps_59_94()		59.940059...	NTSC video fields
//	    fps_60()		60.0		60Hz HDTV fields
//
//	Functions that try to convert inexact frame rates into exact ones:
//
//	    Given a frame rate, fps, that is close to one of the pre-defined
//	    frame rates fps_23_976(), fps_29_97(), fps_47_952() or fps_59_94(),
//	    guessExactFps(fps) returns the corresponding pre-defined frame
//	    rate.  If fps is not close to one of the pre-defined frame rates,
//	    then guessExactFps(fps) returns Rational(fps).
//
//-----------------------------------------------------------------------------

#include "ImfRational.h"
#include "ImfNamespace.h"
#include "ImfExport.h"


OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER

src/Source/OpenEXR/IlmImf/ImfFramesPerSecond.h  view on Meta::CPAN

inline Rational	fps_24 ()	{return Rational (24, 1);}
inline Rational	fps_25 ()	{return Rational (25, 1);}
inline Rational	fps_29_97 ()	{return Rational (30000, 1001);}
inline Rational	fps_30 ()	{return Rational (30, 1);}
inline Rational	fps_47_952 ()	{return Rational (48000, 1001);}
inline Rational	fps_48 ()	{return Rational (48, 1);}
inline Rational	fps_50 ()	{return Rational (50, 1);}
inline Rational	fps_59_94 ()	{return Rational (60000, 1001);}
inline Rational	fps_60 ()	{return Rational (60, 1);}

IMF_EXPORT Rational	guessExactFps (double fps);
IMF_EXPORT Rational	guessExactFps (const Rational &fps);


OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT


#endif

src/Source/ZLib/INDEX  view on Meta::CPAN

CMakeLists.txt  cmake build file
ChangeLog       history of changes
FAQ             Frequently Asked Questions about zlib
INDEX           this file
Makefile        dummy Makefile that tells you to ./configure
Makefile.in     template for Unix Makefile
README          guess what
configure       configure script for Unix
make_vms.com    makefile for VMS
test/example.c  zlib usages examples for build testing
test/minigzip.c minimal gzip-like functionality for build testing
test/infcover.c inf*.c code coverage for build coverage testing
treebuild.xml   XML description of source file dependencies
zconf.h.cmakein zconf.h template for cmake
zconf.h.in      zconf.h template for configure
zlib.3          Man page for zlib
zlib.3.pdf      Man page in PDF format

src/Source/ZLib/trees.c  view on Meta::CPAN

        dist--;             /* dist = match distance - 1 */
        Assert((ush)dist < (ush)MAX_DIST(s) &&
               (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
               (ush)d_code(dist) < (ush)D_CODES,  "_tr_tally: bad match");

        s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
        s->dyn_dtree[d_code(dist)].Freq++;
    }

#ifdef TRUNCATE_BLOCK
    /* Try to guess if it is profitable to stop the current block here */
    if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
        /* Compute an upper bound for the compressed length */
        ulg out_length = (ulg)s->last_lit*8L;
        ulg in_length = (ulg)((long)s->strstart - s->block_start);
        int dcode;
        for (dcode = 0; dcode < D_CODES; dcode++) {
            out_length += (ulg)s->dyn_dtree[dcode].Freq *
                (5L+extra_dbits[dcode]);
        }
        out_length >>= 3;

src/Source/ZLib/zlib.h  view on Meta::CPAN

    uInt     avail_out; /* remaining free space at next_out */
    uLong    total_out; /* total number of bytes output so far */

    z_const char *msg;  /* last error message, NULL if no error */
    struct internal_state FAR *state; /* not visible by applications */

    alloc_func zalloc;  /* used to allocate the internal state */
    free_func  zfree;   /* used to free the internal state */
    voidpf     opaque;  /* private data object passed to zalloc and zfree */

    int     data_type;  /* best guess about the data type: binary or text */
    uLong   adler;      /* adler32 value of the uncompressed data */
    uLong   reserved;   /* reserved for future use */
} z_stream;

typedef z_stream FAR *z_streamp;

/*
     gzip header information passed to and from zlib routines.  See RFC 1952
  for more details on the meanings of these fields.
*/

src/Source/ZLib/zlib.h  view on Meta::CPAN


    Z_FINISH can be used immediately after deflateInit if all the compression
  is to be done in a single step.  In this case, avail_out must be at least the
  value returned by deflateBound (see below).  Then deflate is guaranteed to
  return Z_STREAM_END.  If not enough output space is provided, deflate will
  not return Z_STREAM_END, and it must be called again as described above.

    deflate() sets strm->adler to the adler32 checksum of all input read
  so far (that is, total_in bytes).

    deflate() may update strm->data_type if it can make a good guess about
  the input data type (Z_BINARY or Z_TEXT).  In doubt, the data is considered
  binary.  This field is only for information purposes and does not affect the
  compression algorithm in any manner.

    deflate() returns Z_OK if some progress has been made (more input
  processed or more output produced), Z_STREAM_END if all input has been
  consumed and all output has been produced (only when flush is set to
  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
  if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible
  (for example avail_in or avail_out was zero).  Note that Z_BUF_ERROR is not



( run in 0.462 second using v1.01-cache-2.11-cpan-702932259ff )