mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 15:48:00 +02:00
Move cairo-jpeg-info.c to cairo-image-info.c
Other image formats will be added to the same file.
This commit is contained in:
parent
63180edf6f
commit
5de1e4de93
7 changed files with 30 additions and 30 deletions
|
|
@ -64,7 +64,7 @@ cairo_private = \
|
|||
cairo-freelist-private.h \
|
||||
cairo-gstate-private.h \
|
||||
cairo-hash-private.h \
|
||||
cairo-jpeg-info-private.h \
|
||||
cairo-image-info-private.h \
|
||||
cairo-malloc-private.h \
|
||||
cairo-meta-surface-private.h \
|
||||
cairo-mutex-impl-private.h \
|
||||
|
|
@ -109,8 +109,8 @@ cairo_sources = \
|
|||
cairo-gstate.c \
|
||||
cairo-hash.c \
|
||||
cairo-hull.c \
|
||||
cairo-image-info.c \
|
||||
cairo-image-surface.c \
|
||||
cairo-jpeg-info.c \
|
||||
cairo-lzw.c \
|
||||
cairo-matrix.c \
|
||||
cairo-meta-surface.c \
|
||||
|
|
|
|||
|
|
@ -33,22 +33,22 @@
|
|||
* Adrian Johnson <ajohnson@redneon.com>
|
||||
*/
|
||||
|
||||
#ifndef CAIRO_JPEG_INFO_PRIVATE_H
|
||||
#define CAIRO_JPEG_INFO_PRIVATE_H
|
||||
#ifndef CAIRO_IMAGE_INFO_PRIVATE_H
|
||||
#define CAIRO_IMAGE_INFO_PRIVATE_H
|
||||
|
||||
#include "cairoint.h"
|
||||
|
||||
typedef struct _cairo_jpeg_info {
|
||||
typedef struct _cairo_image_info {
|
||||
int width;
|
||||
int height;
|
||||
int num_components;
|
||||
int bits_per_component;
|
||||
} cairo_jpeg_info_t;
|
||||
} cairo_image_info_t;
|
||||
|
||||
cairo_private cairo_int_status_t
|
||||
_cairo_jpeg_get_info (const unsigned char *data,
|
||||
long length,
|
||||
cairo_jpeg_info_t *info);
|
||||
_cairo_image_info_get_jpeg_info (cairo_image_info_t *info,
|
||||
const unsigned char *data,
|
||||
long length);
|
||||
|
||||
|
||||
#endif /* CAIRO_JPEG_INFO_PRIVATE_H */
|
||||
#endif /* CAIRO_IMAGE_INFO_PRIVATE_H */
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
*/
|
||||
|
||||
#include "cairoint.h"
|
||||
#include "cairo-jpeg-info-private.h"
|
||||
#include "cairo-image-info-private.h"
|
||||
|
||||
/* Markers with no parameters. All other markers are followed by a two
|
||||
* byte length of the parameters. */
|
||||
|
|
@ -60,7 +60,7 @@
|
|||
#define SOF15 0xcf
|
||||
|
||||
static const unsigned char *
|
||||
_skip_segment (const unsigned char *p)
|
||||
_jpeg_skip_segment (const unsigned char *p)
|
||||
{
|
||||
int len;
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ _skip_segment (const unsigned char *p)
|
|||
}
|
||||
|
||||
static void
|
||||
_extract_info (cairo_jpeg_info_t *info, const unsigned char *p)
|
||||
_jpeg_extract_info (cairo_image_info_t *info, const unsigned char *p)
|
||||
{
|
||||
info->width = (p[6] << 8) + p[7];
|
||||
info->height = (p[4] << 8) + p[5];
|
||||
|
|
@ -80,9 +80,9 @@ _extract_info (cairo_jpeg_info_t *info, const unsigned char *p)
|
|||
}
|
||||
|
||||
cairo_int_status_t
|
||||
_cairo_jpeg_get_info (const unsigned char *data,
|
||||
long length,
|
||||
cairo_jpeg_info_t *info)
|
||||
_cairo_image_info_get_jpeg_info (cairo_image_info_t *info,
|
||||
const unsigned char *data,
|
||||
long length)
|
||||
{
|
||||
const unsigned char *p = data;
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ _cairo_jpeg_get_info (const unsigned char *data,
|
|||
if (p + 8 > data + length)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
_extract_info (info, p);
|
||||
_jpeg_extract_info (info, p);
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
default:
|
||||
|
|
@ -132,7 +132,7 @@ _cairo_jpeg_get_info (const unsigned char *data,
|
|||
if (p + 2 > data + length)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
p = _skip_segment (p);
|
||||
p = _jpeg_skip_segment (p);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -45,12 +45,12 @@
|
|||
#include "cairo-pdf-surface-private.h"
|
||||
#include "cairo-pdf-operators-private.h"
|
||||
#include "cairo-analysis-surface-private.h"
|
||||
#include "cairo-image-info-private.h"
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-output-stream-private.h"
|
||||
#include "cairo-paginated-private.h"
|
||||
#include "cairo-scaled-font-subsets-private.h"
|
||||
#include "cairo-type3-glyph-surface-private.h"
|
||||
#include "cairo-jpeg-info-private.h"
|
||||
|
||||
#include <time.h>
|
||||
#include <zlib.h>
|
||||
|
|
@ -1561,14 +1561,14 @@ _cairo_pdf_surface_emit_jpeg_image (cairo_pdf_surface_t *surface,
|
|||
cairo_status_t status;
|
||||
const unsigned char *mime_data;
|
||||
unsigned int mime_data_length;
|
||||
cairo_jpeg_info_t info;
|
||||
cairo_image_info_t info;
|
||||
|
||||
cairo_surface_get_mime_data (source, CAIRO_MIME_TYPE_JPEG,
|
||||
&mime_data, &mime_data_length);
|
||||
if (mime_data == NULL)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
status = _cairo_jpeg_get_info (mime_data, mime_data_length, &info);
|
||||
status = _cairo_image_info_get_jpeg_info (&info, mime_data, mime_data_length);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-output-stream-private.h"
|
||||
#include "cairo-type3-glyph-surface-private.h"
|
||||
#include "cairo-jpeg-info-private.h"
|
||||
#include "cairo-image-info-private.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
|
@ -2130,14 +2130,14 @@ _cairo_ps_surface_emit_jpeg_image (cairo_ps_surface_t *surface,
|
|||
cairo_status_t status;
|
||||
const unsigned char *mime_data;
|
||||
unsigned int mime_data_length;
|
||||
cairo_jpeg_info_t info;
|
||||
cairo_image_info_t info;
|
||||
|
||||
cairo_surface_get_mime_data (source, CAIRO_MIME_TYPE_JPEG,
|
||||
&mime_data, &mime_data_length);
|
||||
if (mime_data == NULL)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
status = _cairo_jpeg_get_info (mime_data, mime_data_length, &info);
|
||||
status = _cairo_image_info_get_jpeg_info (&info, mime_data, mime_data_length);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
#include "cairoint.h"
|
||||
#include "cairo-svg.h"
|
||||
#include "cairo-analysis-surface-private.h"
|
||||
#include "cairo-jpeg-info-private.h"
|
||||
#include "cairo-image-info-private.h"
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-output-stream-private.h"
|
||||
#include "cairo-path-fixed-private.h"
|
||||
|
|
@ -982,7 +982,7 @@ _cairo_surface_base64_encode_jpeg (cairo_surface_t *surface,
|
|||
{
|
||||
const unsigned char *mime_data;
|
||||
unsigned int mime_data_length;
|
||||
cairo_jpeg_info_t jpeg_info;
|
||||
cairo_image_info_t image_info;
|
||||
base64_write_closure_t info;
|
||||
cairo_status_t status;
|
||||
|
||||
|
|
@ -991,7 +991,7 @@ _cairo_surface_base64_encode_jpeg (cairo_surface_t *surface,
|
|||
if (mime_data == NULL)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
status = _cairo_jpeg_get_info (mime_data, mime_data_length, &jpeg_info);
|
||||
status = _cairo_image_info_get_jpeg_info (&image_info, mime_data, mime_data_length);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
#include "cairo-win32-private.h"
|
||||
#include "cairo-meta-surface-private.h"
|
||||
#include "cairo-scaled-font-subsets-private.h"
|
||||
#include "cairo-jpeg-info-private.h"
|
||||
#include "cairo-image-info-private.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
|
|
@ -511,7 +511,7 @@ _cairo_win32_printing_surface_check_jpeg (cairo_win32_surface_t *surface,
|
|||
{
|
||||
const unsigned char *mime_data;
|
||||
unsigned int mime_data_length;
|
||||
cairo_jpeg_info_t info;
|
||||
cairo_image_info_t info;
|
||||
cairo_int_status_t status;
|
||||
DWORD result;
|
||||
|
||||
|
|
@ -523,7 +523,7 @@ _cairo_win32_printing_surface_check_jpeg (cairo_win32_surface_t *surface,
|
|||
if (mime_data == NULL)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
status = _cairo_jpeg_get_info (mime_data, mime_data_length, &info);
|
||||
status = _cairo_image_info_get_jpeg_info (&info, mime_data, mime_data_length);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue