View Single Post
  #6   Spotlight this post!  
Unread 25-06-2016, 17:46
nickbrickmaster's Avatar
nickbrickmaster nickbrickmaster is online now
Not Allowed Near Power Tools
AKA: Nick Schatz
FRC #3184 (Blaze Robotics)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Eagan MN
Posts: 149
nickbrickmaster is an unknown quantity at this point
Re: Method From ColorImage

Quote:
Originally Posted by euhlmann View Post
2. Reflection!
Code:
Constructor<BinaryImage> ct = BinaryImage.class.getDeclaredConstructor();
ct.setAccessible(true);
BinaryImage img = ct.newInstance();
Or modify WPILib and compile it together with your project, probably a solution that makes more sense.
Ew. If it's not visible, it's not meant to be accessible. Reflection is not a tool that should be used in this context. If it's an API, it's not meant to be modified and compiled with your project. Use the tools correctly, and your problems will decrease. Use them incorrectly, and they will multiply.

As for an actual answer, you're not supposed to initialize a BinaryImage. You get them from methods like this one.
__________________
I have approximate knowledge of many things.

FRC 3184: 2014-, FTC 10648: 2015-
Reply With Quote