LiVES 1.3.11-svn
src/colourspace.h
Go to the documentation of this file.
00001 // colourspace.h
00002 // LiVES
00003 // (c) G. Finch 2004 - 2010 <salsaman@xs4all.nl>
00004 // Released under the GPL 3 or later
00005 // see file ../COPYING for licensing details
00006 
00007 // headers for palette conversions
00008 
00009 typedef struct {
00010   guchar u0;
00011   guchar y0;
00012   guchar v0;
00013   guchar y1;
00014 } uyvy_macropixel;
00015 
00016 typedef struct {
00017   guchar y0;
00018   guchar u0;
00019   guchar y1;
00020   guchar v0;
00021 } yuyv_macropixel;
00022 
00023 
00024 typedef struct {
00025   guchar u2;
00026   guchar y0;
00027   guchar y1;
00028   guchar v2;
00029   guchar y2;
00030   guchar y3;
00031 } yuv411_macropixel;
00032 
00033 
00035 // these functions should be used in future
00036 gboolean convert_layer_palette(weed_plant_t *layer, int outpl, int op_clamping);
00037 gboolean convert_layer_palette_with_sampling(weed_plant_t *layer, int outpl, int out_sampling);
00038 gboolean apply_gamma (weed_plant_t *ilayer, weed_plant_t *olayer, double gamma); 
00039 void resize_layer (weed_plant_t *layer, int width, int height, int interp);
00040 void create_empty_pixel_data(weed_plant_t *layer);
00041 void pixel_data_planar_from_membuf(void **pixel_data, void *data, size_t size, int palette);
00042 GdkPixbuf *layer_to_pixbuf (weed_plant_t *layer);
00043 gboolean pixbuf_to_layer(weed_plant_t *layer, GdkPixbuf *);
00044 
00045 weed_plant_t *weed_layer_copy (weed_plant_t *dlayer, weed_plant_t *slayer);
00046 void weed_layer_free (weed_plant_t *layer);
00047 weed_plant_t *weed_layer_new(int width, int height, int *rowstrides, int current_palette);
00048 int weed_layer_get_palette(weed_plant_t *layer);
00049 
00050 // palette information functions
00051 gboolean weed_palette_is_valid_palette(int pal);
00052 gboolean weed_palette_is_alpha_palette(int pal);
00053 gboolean weed_palette_is_rgb_palette(int pal);
00054 gboolean weed_palette_is_yuv_palette(int pal);
00055 gboolean weed_palette_is_float_palette(int pal);
00056 gboolean weed_palette_has_alpha_channel(int pal);
00057 gint weed_palette_get_bits_per_macropixel(int pal);
00058 gint weed_palette_get_pixels_per_macropixel(int pal);
00059 gint weed_palette_get_numplanes(int pal);
00060 gdouble weed_palette_get_plane_ratio_horizontal(int pal, int plane);
00061 gdouble weed_palette_get_plane_ratio_vertical(int pal, int plane);
00062 gboolean weed_palette_is_lower_quality(int p1, int p2);  
00063 gboolean weed_palette_is_resizable(int pal);
00064 gdouble weed_palette_get_compression_ratio (int pal);
00065 
00066 int fourccp_to_weedp (unsigned int fourcc, int bpp, lives_interlace_t *interlace, int *sampling, 
00067                       int *sspace, int *clamping);
00068 
00069 #define BLACK_THRESH 20 ///< if R,G and B values are all <= this, we consider it a "black" pixel
00070 gboolean gdk_pixbuf_is_all_black(GdkPixbuf *pixbuf);
00071 
00072 
00073 const char *weed_palette_get_name(int pal);
00074 const char *weed_yuv_clamping_get_name(int clamping);
00075 const char *weed_yuv_subspace_get_name(int subspace);
00076 gchar *weed_palette_get_name_full(int pal, int clamped, int subspace);
00077 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines