X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fvframe.h;h=5c717200ab16bb7b2099133b40eb174a7716c974;hb=b78b166faf60a1c7357f990b1e2fb0e70be29fee;hp=e6bbc23652ac8a8d1ca082a7a85af386ca52e289;hpb=d66d68b9a5228a2f5894ea39e852df19036af800;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/guicast/vframe.h b/cinelerra-5.1/guicast/vframe.h index e6bbc236..5c717200 100644 --- a/cinelerra-5.1/guicast/vframe.h +++ b/cinelerra-5.1/guicast/vframe.h @@ -29,7 +29,6 @@ #include "bctexture.inc" #include "bcwindowbase.inc" #include "bccmodels.h" -#include "bccmodels.h" #include "vframe.inc" // Maximum number of prev or next effects to be pushed onto the stacks. @@ -112,8 +111,11 @@ public: int data_size, int data_allocated); -// Write a PNG for debugging +// Write a PNG/PPM for debugging int write_png(const char *path); + static void write_ppm(VFrame *vfrm, const char *fmt, ...); + void write_ppm(const char *path) { write_ppm(this, "%s", path); } +//static int n = 0; write_ppm(vframe, "/tmp/data/f%05d", ++n); // if frame points to the same data as this return 1 int equals(VFrame *frame); @@ -137,7 +139,8 @@ public: return transfer_from(frame, bg_color, 0,0, frame->get_w(),frame->get_h()); } // Required for YUV - int clear_frame(); + void black_frame(); + void clear_frame(); int allocate_compressed_data(long bytes); // Sequence number. -1 means invalid. Passing frames to the encoder is @@ -280,12 +283,7 @@ public: BC_PBuffer* get_pbuffer(); // Bind the frame's texture to GL_TEXTURE_2D and enable it. -// If a texture_unit is supplied, the texture unit is made active -// and the commands are run in the right sequence to -// initialize it to our preferred specifications. - void bind_texture(int texture_unit = -1); - - + void bind_texture(int texture_unit, int nearest=0); // Create a frustum with 0,0 in the upper left and w,-h in the bottom right. // Set preferred opengl settings. @@ -293,6 +291,11 @@ public: // Calls init_screen with the current frame's dimensions. void init_screen(); +// color used by clear_frame, default -1 (unset) which clears to BLACK + void set_clear_color(int color, int alpha); + int get_clear_color(); + int get_clear_alpha(); + // Compiles and links the shaders into a program. // Adds the program with put_shader. // Returns the program handle. @@ -346,8 +349,7 @@ public: virtual int draw_pixel(int x, int y); int pixel_rgb, pixel_yuv, stipple; - void set_pixel_color(int rgb); - void set_pixel_color(int rgb, int a) { set_pixel_color((rgb&0xffffff)|((~a&0xff)<<24)); } + void set_pixel_color(int rgb, int a=0xff); void set_stiple(int mask); void draw_line(int x1, int y1, int x2, int y2); void draw_smooth(int x1, int y1, int x2, int y2, int x3, int y3); @@ -435,6 +437,8 @@ private: unsigned char *a; // Dimensions of frame int w, h; +// color used by clear_frame + int clear_color, clear_alpha; // Info for reading png images const unsigned char *image; long image_offset;