rework android-rmt display, add a few buttons
[goodguy/history.git] / cinelerra-5.0 / guicast / vframe.h
index b0a221c78654f3d3493efc3e3b55219522dbc017..575968916c302476241c2bd5a7d966a38cd8df5f 100644 (file)
@@ -32,9 +32,6 @@
 #include "bccmodels.h"
 #include "vframe.inc"
 
-class PngReadFunction;
-
-
 // Maximum number of prev or next effects to be pushed onto the stacks.
 #define MAX_STACK_ELEMENTS 255
 
@@ -52,6 +49,8 @@ public:
 
 class VFrame
 {
+       friend class VFramePng;
+       friend class PngReadFunction;
 public:
 // Create new frame with shared data if *data is nonzero.
 // Pass 0 to *data & -1 to shmid if private data is desired.
@@ -80,16 +79,11 @@ public:
                int color_model,
                long bytes_per_line);
 
-// Create a frame with the png image
-       VFrame(unsigned char *png_data);
-       VFrame(unsigned char *png_data, long image_size);
        VFrame(VFrame &vframe);
 // Create new frame for compressed data.
        VFrame();
        ~VFrame();
 
-       friend class PngReadFunction;
-
 // Return 1 if the colormodel and dimensions are the same
 // Used by FrameCache
        int equivalent(VFrame *src, int test_stacks = 0);
@@ -118,9 +112,6 @@ public:
                int data_size,
                int data_allocated);
 
-// Read a PNG into the frame with alpha
-       int read_png(const unsigned char *data);
-       int read_png(const unsigned char *data, long image_size);
 // Write a PNG for debugging
        int write_png(const char *path);
 
@@ -335,6 +326,10 @@ public:
 // Relevant configuration parameters must be passed on.
        BC_Hash* get_params();
 
+// get/set read status  -1/err, 0/noxfer, 1/ok
+       int get_status() { return status; }
+       void set_status(int v) { status = v; }
+
 // Compare stacks and params from 2 images and return 1 if equal.
        int equal_stacks(VFrame *src);
 
@@ -347,6 +342,11 @@ public:
 // This clears the stacks and the param table
        void clear_stacks();
 
+       void draw_rect(int x1, int y1, int x2, int y2);
+       void draw_line(int x1, int y1, int x2, int y2);
+       void draw_pixel(int x, int y);
+       void draw_arrow(int x1, int y1, int x2, int y2);
+
 // 3D scene graphs
 // Not integrated with shmem because that only affects codecs
        VFrameScene* get_scene();
@@ -357,13 +357,6 @@ public:
 
        void dump_params();
 
-// Shared memory utils
-       static int filefork_size();
-
-       void to_filefork(unsigned char *buffer);
-
-       void from_filefork(unsigned char *buffer);
-
 private:
 
 // 3D scene graphs
@@ -438,7 +431,8 @@ private:
 // For writing discontinuous frames in background rendering
        long sequence_number;
        double timestamp;
-
+// read status of input frame -1/err, 0/noxfr, 1/ok
+       int status;
 // OpenGL support
        int is_keyframe;
 // State of the current texture
@@ -454,5 +448,14 @@ private:
        BC_Hash *params;
 };
 
+// Create a frame with the png image
+class VFramePng : public VFrame {
+// Read a PNG into the frame with alpha
+       int read_png(const unsigned char *data, long image_size, double xscale, double yscale);
+public:
+       VFramePng(unsigned char *png_data, double scale=0);
+       VFramePng(unsigned char *png_data, long image_size, double xs=0, double ys=0);
+       ~VFramePng();
+};
 
 #endif