guacamole-spice-protocol/src/libguac/palette.h

48 lines
1.3 KiB
C
Raw Normal View History

/*
2016-03-25 19:59:40 +00:00
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
2012-04-02 04:49:15 +00:00
*
2016-03-25 19:59:40 +00:00
* http://www.apache.org/licenses/LICENSE-2.0
2012-04-02 04:49:15 +00:00
*
2016-03-25 19:59:40 +00:00
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
2012-04-02 04:49:15 +00:00
#ifndef __GUAC_PALETTE_H
#define __GUAC_PALETTE_H
#include <cairo/cairo.h>
2014-01-01 22:44:28 +00:00
#include <png.h>
2012-04-02 04:49:15 +00:00
typedef struct guac_palette_entry {
int index;
int color;
} guac_palette_entry;
typedef struct guac_palette {
guac_palette_entry entries[0x1000];
png_color colors[256];
int size;
2012-04-02 04:49:15 +00:00
} guac_palette;
2012-04-02 04:54:03 +00:00
guac_palette* guac_palette_alloc(cairo_surface_t* surface);
2012-04-02 04:57:19 +00:00
int guac_palette_find(guac_palette* palette, int color);
2012-04-02 04:54:03 +00:00
void guac_palette_free(guac_palette* palette);
2012-04-02 04:49:15 +00:00
#endif