Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
glcomptextpng.c
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#include <glcomp/glcompfont.h>
13#include <gtk/gtk.h>
14#include <png.h>
15#include <stddef.h>
16
17unsigned char *glCompLoadPng(cairo_surface_t **surface, const char *filename,
18 int *imageWidth, int *imageHeight) {
19 *surface = cairo_image_surface_create_from_png(filename);
20 if (*surface == NULL ||
21 cairo_surface_status(*surface) != CAIRO_STATUS_SUCCESS) {
22 return NULL;
23 }
24 *imageWidth = cairo_image_surface_get_width(*surface);
25 *imageHeight = cairo_image_surface_get_height(*surface);
26 return cairo_image_surface_get_data(*surface);
27}
unsigned char * glCompLoadPng(cairo_surface_t **surface, const char *filename, int *imageWidth, int *imageHeight)
node NULL
Definition grammar.y:163