anonymous contribution for much improved ChromakeyHSV plugin menu with boxes to set...
[goodguy/cinelerra.git] / cinelerra-5.1 / guicast / bctheme.C
index c206f258af27131ab8e8dd0a3e1d12a3812444ef..9addf9f7eb8f888ad6db8ff81e336b9c2627a73a 100644 (file)
@@ -79,6 +79,17 @@ VFrame* BC_Theme::new_image(const char *path)
        return new_image("", path);
 }
 
+VFrame* BC_Theme::new_image1(const char *title, const char *path)
+{
+       VFrame *existing_image = title[0] ? get_image(title, 0) : 0;
+       if( existing_image ) return existing_image;
+
+       BC_ThemeSet *result = new BC_ThemeSet(1, 0, title);
+       result->data[0] = new VFramePng(get_image_data(path), 1.);
+       add_image_set(result);
+       return result->data[0];
+}
+
 // These create image sets which are stored in the image_sets table.
 VFrame** BC_Theme::new_image_set(const char *title, int total, va_list *args)
 {
@@ -444,7 +455,10 @@ void BC_Theme::overlay(VFrame *dst, VFrame *src, int in_x1, int in_x2, int shift
 
 void BC_Theme::set_data(unsigned char *ptr)
 {
-       int hdr_sz = *(int*)ptr - sizeof(int);
+       //int hdr_sz = *(int*)ptr - sizeof(int);
+       int hdr_sz = 0;
+       memcpy(&hdr_sz, ptr, sizeof(int));
+       hdr_sz -= sizeof(int);
        unsigned char *cp = ptr + sizeof(int);
        unsigned char *dp = cp + hdr_sz;
        int start_item = images.size();