14#ifndef OPENCVTEXTURE_H
15#define OPENCVTEXTURE_H
31 OpenCVTexture(
const std::string &name = std::string());
32 OpenCVTexture(
const OpenCVTexture ©) =
delete;
33 virtual ~OpenCVTexture();
35 bool from_camera(
int camera_index = -1,
int z = 0,
36 int alpha_file_channel = 0,
37 const LoaderOptions &options = LoaderOptions());
40 static PT(Texture) make_texture();
43 virtual void consider_update();
44 virtual PT(Texture) make_copy_impl()
const;
45 void do_assign(Texture::CData *cdata_tex,
const OpenCVTexture *copy,
46 const Texture::CData *cdata_copy_tex);
48 virtual void do_update_frame(Texture::CData *cdata_tex,
int frame);
49 virtual void do_update_frame(Texture::CData *cdata_tex,
int frame,
int z);
51 virtual bool do_read_one(Texture::CData *cdata,
52 const Filename &fullpath,
const Filename &alpha_fullpath,
53 int z,
int n,
int primary_file_num_channels,
int alpha_file_channel,
54 const LoaderOptions &options,
55 bool header_only, BamCacheRecord *record);
56 virtual bool do_load_one(Texture::CData *cdata,
57 const PNMImage &pnmimage,
const std::string &name,
58 int z,
int n,
const LoaderOptions &options);
64 VideoPage &do_modify_page(
const Texture::CData *cdata,
int z);
65 bool do_reconsider_video_properties(Texture::CData *cdata,
66 const VideoStream &stream,
67 int num_components,
int z,
68 const LoaderOptions &options);
74 VideoStream(
const VideoStream ©);
77 bool read(
const Filename &filename);
78 bool from_camera(
int camera_index);
80 INLINE
bool is_valid()
const;
81 INLINE
bool is_from_file()
const;
82 bool get_frame_data(
int frame,
83 const unsigned char *&r,
84 const unsigned char *&g,
85 const unsigned char *&b,
86 int &x_pitch,
int &y_pitch);
97 INLINE VideoPage(
const VideoPage ©);
100 VideoStream _color, _alpha;
103 typedef pvector<VideoPage> Pages;
110 static TypeHandle get_class_type() {
113 static void init_type() {
114 VideoTexture::init_type();
116 VideoTexture::get_class_type());
118 virtual TypeHandle get_type()
const {
119 return get_class_type();
121 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
124 static TypeHandle _type_handle;
static void register_with_read_factory()
Factory method to generate a Texture object.
The base class for a family of animated Textures that take their input from a video source,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.