Skip to content

Commit

Permalink
Change abstract class to interface
Browse files Browse the repository at this point in the history
  • Loading branch information
shaovoon committed Jul 20, 2019
1 parent f1999b7 commit 1f3929b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
20 changes: 12 additions & 8 deletions CSharpEncodeImage/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@

namespace CSharpEncodeImage
{
/*
// render a red image once!
public class RenderRedImage : FrameRenderer
{
public override bool Render(int width, int height, int fps, int frame_cnt, UInt32[] pixels)
public bool Render(int width, int height, int fps, int frame_cnt, UInt32[] pixels)
{
if (frame_cnt == 0)
{
Expand Down Expand Up @@ -53,12 +52,12 @@ static void Main(string[] args)

}
}
*/

/*
// render a jpeg once!
public class RenderJPG : FrameRenderer
{
public override bool Render(int width, int height, int fps, int frame_cnt, UInt32[] pixels)
public bool Render(int width, int height, int fps, int frame_cnt, UInt32[] pixels)
{
if (frame_cnt == 0)
{
Expand Down Expand Up @@ -115,8 +114,8 @@ public override bool Render(int width, int height, int fps, int frame_cnt, UInt3
bmp.UnlockBits(bitmapData);
bmp.Dispose();
bitmapData.Dispose();
jpg.Dispose();
brush.Dispose();
g.Dispose();
}
return true;
Expand Down Expand Up @@ -170,7 +169,7 @@ public Render2JPG(string img1, string img2)
g2.Dispose();
}
public override bool Render(int width, int height, int fps, int frame_cnt, UInt32[] pixels)
public bool Render(int width, int height, int fps, int frame_cnt, UInt32[] pixels)
{
if (bmp == null)
{
Expand Down Expand Up @@ -249,6 +248,8 @@ public override bool Render(int width, int height, int fps, int frame_cnt, UInt3
bmp.UnlockBits(bitmapData);
bmp2.UnlockBits(bitmapData2);
brush.Dispose();
return true;
}
Expand Down Expand Up @@ -303,6 +304,7 @@ static void Main(string[] args)
}
*/

/*
// text animation!
public class RenderText : FrameRenderer
{
Expand All @@ -325,7 +327,7 @@ public RenderText(string img1, string img2)
g2.Dispose();
}
public override bool Render(int width, int height, int fps, int frame_cnt, UInt32[] pixels)
public bool Render(int width, int height, int fps, int frame_cnt, UInt32[] pixels)
{
if (bmp == null)
{
Expand Down Expand Up @@ -406,6 +408,8 @@ public override bool Render(int width, int height, int fps, int frame_cnt, UInt3
renderbmp.UnlockBits(bitmapData);
renderbmp.Dispose();
brush.Dispose();
whitebrush.Dispose();
render_g.Dispose();
return true;
Expand Down Expand Up @@ -441,5 +445,5 @@ static void Main(string[] args)
}
}

*/
}
4 changes: 2 additions & 2 deletions H264WriterDLL/H264WriterDLL.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ namespace H264WriterDLL {
Software
};

public ref class FrameRenderer abstract
public interface class FrameRenderer
{
public: virtual bool Render(int width, int height, int fps, int frame_cnt, array<System::UInt32>^ pixels) abstract;
public: bool Render(int width, int height, int fps, int frame_cnt, array<System::UInt32>^ pixels);
};

public ref class H264Writer
Expand Down

0 comments on commit 1f3929b

Please sign in to comment.