Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
pngget.c File Reference
#include "png.h"

Go to the source code of this file.

Defines

#define PNG_INTERNAL

Functions

png_uint_32 PNGAPI png_get_valid (png_structp png_ptr, png_infop info_ptr, png_uint_32 flag)
png_uint_32 PNGAPI png_get_rowbytes (png_structp png_ptr, png_infop info_ptr)
png_byte PNGAPI png_get_channels (png_structp png_ptr, png_infop info_ptr)
png_bytep PNGAPI png_get_signature (png_structp png_ptr, png_infop info_ptr)
png_uint_32 PNGAPI png_get_gAMA (png_structp png_ptr, png_infop info_ptr, double *file_gamma)
png_uint_32 PNGAPI png_get_sRGB (png_structp png_ptr, png_infop info_ptr, int *file_srgb_intent)
png_uint_32 PNGAPI png_get_IHDR (png_structp png_ptr, png_infop info_ptr, png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type, int *interlace_type, int *compression_type, int *filter_type)
png_uint_32 PNGAPI png_get_PLTE (png_structp png_ptr, png_infop info_ptr, png_colorp *palette, int *num_palette)
png_uint_32 PNGAPI png_get_tRNS (png_structp png_ptr, png_infop info_ptr, png_bytep *trans, int *num_trans, png_color_16p *trans_values)
png_uint_32 PNGAPI png_get_asm_flags (png_structp png_ptr)
png_uint_32 PNGAPI png_get_asm_flagmask (int flag_select)
png_uint_32 PNGAPI png_get_mmx_flagmask (int flag_select, int *compilerID)
png_byte PNGAPI png_get_mmx_bitdepth_threshold (png_structp png_ptr)
png_uint_32 PNGAPI png_get_mmx_rowbytes_threshold (png_structp png_ptr)
png_uint_32 PNGAPI png_get_user_width_max (png_structp png_ptr)
png_uint_32 PNGAPI png_get_user_height_max (png_structp png_ptr)

Define Documentation

Definition at line 11 of file pngget.c.


Function Documentation

Definition at line 841 of file pngget.c.

{
    png_uint_32 settable_asm_flags = 0;

    if (flag_select & PNG_SELECT_READ)
        settable_asm_flags |=
          PNG_ASM_FLAG_MMX_READ_COMBINE_ROW  |
          PNG_ASM_FLAG_MMX_READ_INTERLACE    |
          PNG_ASM_FLAG_MMX_READ_FILTER_SUB   |
          PNG_ASM_FLAG_MMX_READ_FILTER_UP    |
          PNG_ASM_FLAG_MMX_READ_FILTER_AVG   |
          PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ;
          /* no non-MMX flags yet */

#if 0
    /* GRR:  no write-flags yet, either, but someday... */
    if (flag_select & PNG_SELECT_WRITE)
        settable_asm_flags |=
          PNG_ASM_FLAG_MMX_WRITE_ [whatever] ;
#endif /* 0 */

    return settable_asm_flags;  /* _theoretically_ settable capabilities only */
}

Definition at line 834 of file pngget.c.

{
    return (png_uint_32)(png_ptr? png_ptr->asm_flags : 0L);
}
png_byte PNGAPI png_get_channels ( png_structp  png_ptr,
png_infop  info_ptr 
)

Definition at line 341 of file pngget.c.

{
   if (png_ptr != NULL && info_ptr != NULL)
      return(info_ptr->channels);
   else
      return (0);
}

Here is the caller graph for this function:

png_uint_32 PNGAPI png_get_gAMA ( png_structp  png_ptr,
png_infop  info_ptr,
double *  file_gamma 
)

Definition at line 441 of file pngget.c.

{
   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA)
      && file_gamma != NULL)
   {
      png_debug1(1, "in %s retrieval function\n", "gAMA");
      *file_gamma = (double)info_ptr->gamma;
      return (PNG_INFO_gAMA);
   }
   return (0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

png_uint_32 PNGAPI png_get_IHDR ( png_structp  png_ptr,
png_infop  info_ptr,
png_uint_32 width,
png_uint_32 height,
int bit_depth,
int color_type,
int interlace_type,
int compression_type,
int filter_type 
)

Definition at line 534 of file pngget.c.

{
   if (png_ptr != NULL && info_ptr != NULL && width != NULL && height != NULL &&
      bit_depth != NULL && color_type != NULL)
   {
      png_debug1(1, "in %s retrieval function\n", "IHDR");
      *width = info_ptr->width;
      *height = info_ptr->height;
      *bit_depth = info_ptr->bit_depth;
      if (info_ptr->bit_depth < 1 || info_ptr->bit_depth > 16)
        png_error(png_ptr, "Invalid bit depth");
      *color_type = info_ptr->color_type;
      if (info_ptr->color_type > 6)
        png_error(png_ptr, "Invalid color type");
      if (compression_type != NULL)
         *compression_type = info_ptr->compression_type;
      if (filter_type != NULL)
         *filter_type = info_ptr->filter_type;
      if (interlace_type != NULL)
         *interlace_type = info_ptr->interlace_type;

      /* check for potential overflow of rowbytes */
      if (width == 0 || *width > PNG_UINT_31_MAX)
        png_error(png_ptr, "Invalid image width");
      if (height == 0 || *height > PNG_UINT_31_MAX)
        png_error(png_ptr, "Invalid image height");
      if (info_ptr->width > (PNG_UINT_32_MAX
                 >> 3)      /* 8-byte RGBA pixels */
                 - 64       /* bigrowbuf hack */
                 - 1        /* filter byte */
                 - 7*8      /* rounding of width to multiple of 8 pixels */
                 - 8)       /* extra max_pixel_depth pad */
      {
         png_warning(png_ptr,
            "Width too large for libpng to process image data.");
      }
      return (1);
   }
   return (0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 907 of file pngget.c.

{
    return (png_byte)(png_ptr? png_ptr->mmx_bitdepth_threshold : 0);
}
png_uint_32 PNGAPI png_get_mmx_flagmask ( int  flag_select,
int compilerID 
)

Definition at line 871 of file pngget.c.

{
    png_uint_32 settable_mmx_flags = 0;

    if (flag_select & PNG_SELECT_READ)
        settable_mmx_flags |=
          PNG_ASM_FLAG_MMX_READ_COMBINE_ROW  |
          PNG_ASM_FLAG_MMX_READ_INTERLACE    |
          PNG_ASM_FLAG_MMX_READ_FILTER_SUB   |
          PNG_ASM_FLAG_MMX_READ_FILTER_UP    |
          PNG_ASM_FLAG_MMX_READ_FILTER_AVG   |
          PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ;
#if 0
    /* GRR:  no MMX write support yet, but someday... */
    if (flag_select & PNG_SELECT_WRITE)
        settable_mmx_flags |=
          PNG_ASM_FLAG_MMX_WRITE_ [whatever] ;
#endif /* 0 */

    if (compilerID != NULL) {
#ifdef PNG_USE_PNGVCRD
        *compilerID = 1;    /* MSVC */
#else
#ifdef PNG_USE_PNGGCCRD
        *compilerID = 2;    /* gcc/gas */
#else
        *compilerID = -1;   /* unknown (i.e., no asm/MMX code compiled) */
#endif
#endif
    }

    return settable_mmx_flags;  /* _theoretically_ settable capabilities only */
}

Definition at line 914 of file pngget.c.

{
    return (png_uint_32)(png_ptr? png_ptr->mmx_rowbytes_threshold : 0L);
}
png_uint_32 PNGAPI png_get_PLTE ( png_structp  png_ptr,
png_infop  info_ptr,
png_colorp palette,
int num_palette 
)

Definition at line 689 of file pngget.c.

{
   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_PLTE)
       && palette != NULL)
   {
      png_debug1(1, "in %s retrieval function\n", "PLTE");
      *palette = info_ptr->palette;
      *num_palette = info_ptr->num_palette;
      png_debug1(3, "num_palette = %d\n", *num_palette);
      return (PNG_INFO_PLTE);
   }
   return (0);
}

Definition at line 24 of file pngget.c.

{
   if (png_ptr != NULL && info_ptr != NULL)
      return(info_ptr->rowbytes);
   else
      return(0);
}

Definition at line 350 of file pngget.c.

{
   if (png_ptr != NULL && info_ptr != NULL)
      return(info_ptr->signature);
   else
      return (NULL);
}
png_uint_32 PNGAPI png_get_sRGB ( png_structp  png_ptr,
png_infop  info_ptr,
int file_srgb_intent 
)

Definition at line 472 of file pngget.c.

{
   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB)
      && file_srgb_intent != NULL)
   {
      png_debug1(1, "in %s retrieval function\n", "sRGB");
      *file_srgb_intent = (int)info_ptr->srgb_intent;
      return (PNG_INFO_sRGB);
   }
   return (0);
}

Here is the call graph for this function:

png_uint_32 PNGAPI png_get_tRNS ( png_structp  png_ptr,
png_infop  info_ptr,
png_bytep trans,
int num_trans,
png_color_16p trans_values 
)

Definition at line 758 of file pngget.c.

{
   png_uint_32 retval = 0;
   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS))
   {
      png_debug1(1, "in %s retrieval function\n", "tRNS");
      if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
      {
          if (trans != NULL)
          {
             *trans = info_ptr->trans;
             retval |= PNG_INFO_tRNS;
          }
          if (trans_values != NULL)
             *trans_values = &(info_ptr->trans_values);
      }
      else /* if (info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) */
      {
          if (trans_values != NULL)
          {
             *trans_values = &(info_ptr->trans_values);
             retval |= PNG_INFO_tRNS;
          }
          if(trans != NULL)
             *trans = NULL;
      }
      if(num_trans != NULL)
      {
         *num_trans = info_ptr->num_trans;
         retval |= PNG_INFO_tRNS;
      }
   }
   return (retval);
}

Here is the caller graph for this function:

Definition at line 928 of file pngget.c.

{
    return (png_ptr? png_ptr->user_height_max : 0);
}

Definition at line 923 of file pngget.c.

{
    return (png_ptr? png_ptr->user_width_max : 0);
}
png_uint_32 PNGAPI png_get_valid ( png_structp  png_ptr,
png_infop  info_ptr,
png_uint_32  flag 
)

Definition at line 15 of file pngget.c.

{
   if (png_ptr != NULL && info_ptr != NULL)
      return(info_ptr->valid & flag);
   else
      return(0);
}

Here is the caller graph for this function: