Lines Matching refs:format

45     * Base format is one of GL_RED, GL_RG, GL_RGB, GL_RGBA, GL_ALPHA,
76 * Info about each format.
1537 _mesa_get_format_info(gl_format format)
1539 const struct gl_format_info *info = &format_info[format];
1540 assert(info->Name == format);
1545 /** Return string name of format (for debugging) */
1547 _mesa_get_format_name(gl_format format)
1549 const struct gl_format_info *info = _mesa_get_format_info(format);
1556 * Return bytes needed to store a block of pixels in the given format.
1563 _mesa_get_format_bytes(gl_format format)
1565 const struct gl_format_info *info = _mesa_get_format_info(format);
1568 _mesa_is_format_compressed(format));
1574 * Return bits per component for the given format.
1575 * \param format one of MESA_FORMAT_x
1579 _mesa_get_format_bits(gl_format format, GLenum pname)
1581 const struct gl_format_info *info = _mesa_get_format_info(format);
1628 _mesa_get_format_max_bits(gl_format format)
1630 const struct gl_format_info *info = _mesa_get_format_info(format);
1644 * for the given format.
1653 _mesa_get_format_datatype(gl_format format)
1655 const struct gl_format_info *info = _mesa_get_format_info(format);
1661 * Return the basic format for the given type. The result will be one of
1666 _mesa_get_format_base_format(gl_format format)
1668 const struct gl_format_info *info = _mesa_get_format_info(format);
1674 * Return the block size (in pixels) for the given format. Normally
1681 _mesa_get_format_block_size(gl_format format, GLuint *bw, GLuint *bh)
1683 const struct gl_format_info *info = _mesa_get_format_info(format);
1689 /** Is the given format a compressed format? */
1691 _mesa_is_format_compressed(gl_format format)
1693 const struct gl_format_info *info = _mesa_get_format_info(format);
1699 * Determine if the given format represents a packed depth/stencil buffer.
1702 _mesa_is_format_packed_depth_stencil(gl_format format)
1704 const struct gl_format_info *info = _mesa_get_format_info(format);
1711 * Is the given format a signed/unsigned integer color format?
1714 _mesa_is_format_integer_color(gl_format format)
1716 const struct gl_format_info *info = _mesa_get_format_info(format);
1725 * Is the given format an unsigned integer format?
1728 _mesa_is_format_unsigned(gl_format format)
1730 const struct gl_format_info *info = _mesa_get_format_info(format);
1736 * Return color encoding for given format.
1740 _mesa_get_format_color_encoding(gl_format format)
1743 switch (format) {
1761 * For an sRGB format, return the corresponding linear color space format.
1762 * For non-sRGB formats, return the format as-is.
1765 _mesa_get_srgb_format_linear(gl_format format)
1767 switch (format) {
1769 format = MESA_FORMAT_RGB888;
1772 format = MESA_FORMAT_RGBA8888;
1775 format = MESA_FORMAT_ARGB8888;
1778 format = MESA_FORMAT_L8;
1781 format = MESA_FORMAT_AL88;
1784 format = MESA_FORMAT_RGB_DXT1;
1787 format = MESA_FORMAT_RGBA_DXT1;
1790 format = MESA_FORMAT_RGBA_DXT3;
1793 format = MESA_FORMAT_RGBA_DXT5;
1798 return format;
1803 * If the given format is a compressed format, return a corresponding
1804 * uncompressed format.
1807 _mesa_get_uncompressed_format(gl_format format)
1809 switch (format) {
1846 assert(!_mesa_is_format_compressed(format));
1848 return format;
1854 _mesa_format_num_components(gl_format format)
1856 const struct gl_format_info *info = _mesa_get_format_info(format);
1870 * in the given format.
1873 _mesa_format_image_size(gl_format format, GLsizei width,
1876 const struct gl_format_info *info = _mesa_get_format_info(format);
1879 /* compressed format (2D only for now) */
1899 _mesa_format_image_size64(gl_format format, GLsizei width,
1902 const struct gl_format_info *info = _mesa_get_format_info(format);
1905 /* compressed format (2D only for now) */
1925 _mesa_format_row_stride(gl_format format, GLsizei width)
1927 const struct gl_format_info *info = _mesa_get_format_info(format);
1930 /* compressed format */
1957 /* This function will emit a problem/warning if the format is
1966 * Do sanity checking of the format info table.
2061 _mesa_format_to_type_and_comps(gl_format format,
2064 switch (format) {
2529 _mesa_problem(NULL, "bad format %s in _mesa_format_to_type_and_comps",
2530 _mesa_get_format_name(format));
2540 * \param format the user-specified image format
2547 GLenum format, GLenum type,
2552 /* Note: When reading a GL format/type combination, the format lists channel
2568 if (format == GL_RGBA && type == GL_UNSIGNED_INT_8_8_8_8 && !swapBytes)
2571 if (format == GL_RGBA && type == GL_UNSIGNED_INT_8_8_8_8_REV && swapBytes)
2574 if (format == GL_RGBA && type == GL_UNSIGNED_BYTE && !littleEndian)
2577 if (format == GL_ABGR_EXT && type == GL_UNSIGNED_INT_8_8_8_8_REV
2581 if (format == GL_ABGR_EXT && type == GL_UNSIGNED_INT_8_8_8_8
2585 if (format == GL_ABGR_EXT && type == GL_UNSIGNED_BYTE && littleEndian)
2591 if (format == GL_RGBA && type == GL_UNSIGNED_INT_8_8_8_8_REV &&
2595 if (format == GL_RGBA && type == GL_UNSIGNED_INT_8_8_8_8 && swapBytes)
2598 if (format == GL_RGBA && type == GL_UNSIGNED_BYTE && littleEndian)
2601 if (format == GL_ABGR_EXT && type == GL_UNSIGNED_INT_8_8_8_8 &&
2605 if (format == GL_ABGR_EXT && type == GL_UNSIGNED_INT_8_8_8_8_REV &&
2609 if (format == GL_ABGR_EXT && type == GL_UNSIGNED_BYTE && !littleEndian)
2615 if (format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8_REV &&
2619 if (format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8 && swapBytes)
2622 if (format == GL_BGRA && type == GL_UNSIGNED_BYTE && littleEndian)
2628 if (format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8 && !swapBytes)
2631 if (format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8_REV &&
2635 if (format == GL_BGRA && type == GL_UNSIGNED_BYTE && !littleEndian)
2649 return format == GL_BGR && type == GL_UNSIGNED_BYTE && littleEndian;
2652 return format == GL_RGB && type == GL_UNSIGNED_BYTE && littleEndian;
2655 return format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 && !swapBytes;
2665 return format == GL_BGRA && type == GL_UNSIGNED_SHORT_4_4_4_4_REV &&
2672 return format == GL_RGBA && type == GL_UNSIGNED_SHORT_5_5_5_1 &&
2676 return format == GL_BGRA && type == GL_UNSIGNED_SHORT_1_5_5_5_REV &&
2685 return format == GL_LUMINANCE_ALPHA && type == GL_UNSIGNED_BYTE && littleEndian;
2690 return format == GL_LUMINANCE_ALPHA && type == GL_UNSIGNED_SHORT && littleEndian && !swapBytes;
2695 return format == GL_RGB && type == GL_UNSIGNED_BYTE_3_3_2;
2698 return format == GL_ALPHA && type == GL_UNSIGNED_BYTE;
2700 return format == GL_ALPHA && type == GL_UNSIGNED_SHORT &&
2703 return format == GL_LUMINANCE && type == GL_UNSIGNED_BYTE;
2705 return format == GL_LUMINANCE && type == GL_UNSIGNED_SHORT &&
2708 return format == GL_INTENSITY && type == GL_UNSIGNED_BYTE;
2710 return format == GL_INTENSITY && type == GL_UNSIGNED_SHORT &&
2718 return format == GL_RED && type == GL_UNSIGNED_BYTE;
2720 return format == GL_RG && type == GL_UNSIGNED_BYTE && littleEndian;
2725 return format == GL_RED && type == GL_UNSIGNED_SHORT && littleEndian &&
2728 return format == GL_RG && type == GL_UNSIGNED_SHORT && littleEndian &&
2734 return format == GL_BGRA && type == GL_UNSIGNED_INT_2_10_10_10_REV &&
2738 return format == GL_DEPTH_STENCIL && type == GL_UNSIGNED_INT_24_8 &&
2745 return format == GL_DEPTH_COMPONENT && type == GL_UNSIGNED_SHORT &&
2752 return format == GL_DEPTH_COMPONENT && type == GL_UNSIGNED_INT &&
2756 return format == GL_STENCIL_INDEX && type == GL_UNSIGNED_BYTE;
2778 return format == GL_RGBA && type == GL_FLOAT && !swapBytes;
2780 return format == GL_RGBA && type == GL_HALF_FLOAT && !swapBytes;
2783 return format == GL_RGB && type == GL_FLOAT && !swapBytes;
2785 return format == GL_RGB && type == GL_HALF_FLOAT && !swapBytes;
2788 return format == GL_ALPHA && type == GL_FLOAT && !swapBytes;
2790 return format == GL_ALPHA && type == GL_HALF_FLOAT && !swapBytes;
2793 return format == GL_LUMINANCE && type == GL_FLOAT && !swapBytes;
2795 return format == GL_LUMINANCE && type == GL_HALF_FLOAT && !swapBytes;
2798 return format == GL_LUMINANCE_ALPHA && type == GL_FLOAT && !swapBytes;
2800 return format == GL_LUMINANCE_ALPHA && type == GL_HALF_FLOAT && !swapBytes;
2803 return format == GL_INTENSITY && type == GL_FLOAT && !swapBytes;
2805 return format == GL_INTENSITY && type == GL_HALF_FLOAT && !swapBytes;
2808 return format == GL_RED && type == GL_FLOAT && !swapBytes;
2810 return format == GL_RED && type == GL_HALF_FLOAT && !swapBytes;
2813 return format == GL_RG && type == GL_FLOAT && !swapBytes;
2815 return format == GL_RG && type == GL_HALF_FLOAT && !swapBytes;
2885 if (format == GL_RGBA && type == GL_BYTE && !littleEndian)
2888 if (format == GL_ABGR_EXT && type == GL_BYTE && littleEndian)
2894 if (format == GL_RGBA && type == GL_BYTE && littleEndian)
2897 if (format == GL_ABGR_EXT && type == GL_BYTE && !littleEndian)
2937 return (format == GL_BGRA_INTEGER_EXT &&
2942 return (format == GL_RGBA_INTEGER_EXT &&
2947 return format == GL_RGB && type == GL_UNSIGNED_INT_5_9_9_9_REV &&
2951 return format == GL_RGB && type == GL_UNSIGNED_INT_10F_11F_11F_REV &&
2955 return format == GL_DEPTH_COMPONENT && type == GL_FLOAT && !swapBytes;