gem5 v24.0.0.0
|
#include <vncserver.hh>
Classes | |
class | DataEvent |
DataEvent to read data from vnc. More... | |
struct | FrameBufferRect |
struct | FrameBufferUpdate |
class | ListenEvent |
ListenEvent to accept a vnc client connection. More... | |
struct | ServerCutText |
struct | ServerInitMsg |
Public Types | |
enum | ServerMessages { ServerFrameBufferUpdate = 0 , ServerSetColorMapEntries = 1 , ServerBell = 2 , ServerCutText = 3 } |
Server -> Client message IDs. More... | |
enum | EncodingTypes { EncodingRaw = 0 , EncodingCopyRect = 1 , EncodingHextile = 5 , EncodingDesktopSize = -223 } |
Encoding types. More... | |
enum | MouseEvents { MouseLeftButton = 0x1 , MouseRightButton = 0x2 , MouseMiddleButton = 0x4 } |
keyboard/mouse support More... | |
enum | ConnectionState { WaitForProtocolVersion , WaitForSecurityResponse , WaitForClientInit , InitializationPhase , NormalPhase } |
typedef VncServerParams | Params |
Public Types inherited from gem5::VncInput | |
enum | ClientMessages { ClientSetPixelFormat = 0 , ClientSetEncodings = 2 , ClientFrameBufferUpdate = 3 , ClientKeyEvent = 4 , ClientPointerEvent = 5 , ClientCutText = 6 } |
Client -> Server message IDs. More... | |
typedef VncInputParams | Params |
Public Types inherited from gem5::SimObject | |
typedef SimObjectParams | Params |
Public Member Functions | |
const char * | vncVersion () const |
VncServer (const Params &p) | |
VncServer. | |
~VncServer () | |
void | setDirty () override |
The frame buffer uses this call to notify the vnc server that the frame buffer has been updated and a new image needs to be sent to the client. | |
void | frameBufferResized () override |
Public Member Functions inherited from gem5::VncInput | |
VncInput (const Params &p) | |
virtual void | setFrameBuffer (const FrameBuffer *rfb) |
Set the address of the frame buffer we are going to show. | |
void | setKeyboard (VncKeyboard *_keyboard) |
Set up the device that would like to receive notifications when keys are pressed in the vnc client keyboard. | |
void | setMouse (VncMouse *_mouse) |
Setup the device that would like to receive notifications when mouse movements or button presses are received from the vnc client. | |
uint16_t | videoWidth () const |
What is the width of the screen we're displaying. | |
uint16_t | videoHeight () const |
What is the height of the screen we're displaying. | |
Public Member Functions inherited from gem5::SimObject | |
const Params & | params () const |
SimObject (const Params &p) | |
virtual | ~SimObject () |
virtual void | init () |
init() is called after all C++ SimObjects have been created and all ports are connected. | |
virtual void | loadState (CheckpointIn &cp) |
loadState() is called on each SimObject when restoring from a checkpoint. | |
virtual void | initState () |
initState() is called on each SimObject when not restoring from a checkpoint. | |
virtual void | regProbePoints () |
Register probe points for this object. | |
virtual void | regProbeListeners () |
Register probe listeners for this object. | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. | |
virtual Port & | getPort (const std::string &if_name, PortID idx=InvalidPortID) |
Get a port with a given name and index. | |
virtual void | startup () |
startup() is the final initialization call before simulation. | |
DrainState | drain () override |
Provide a default implementation of the drain interface for objects that don't need draining. | |
virtual void | memWriteback () |
Write back dirty buffers to memory using functional writes. | |
virtual void | memInvalidate () |
Invalidate the contents of memory buffers. | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. | |
Public Member Functions inherited from gem5::EventManager | |
EventQueue * | eventQueue () const |
void | schedule (Event &event, Tick when) |
void | deschedule (Event &event) |
void | reschedule (Event &event, Tick when, bool always=false) |
void | schedule (Event *event, Tick when) |
void | deschedule (Event *event) |
void | reschedule (Event *event, Tick when, bool always=false) |
void | wakeupEventQueue (Tick when=(Tick) -1) |
This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. | |
void | setCurTick (Tick newVal) |
EventManager (EventManager &em) | |
Event manger manages events in the event queue. | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
Public Member Functions inherited from gem5::Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Member Functions inherited from gem5::Drainable | |
DrainState | drainState () const |
Return the current drain state of an object. | |
virtual void | notifyFork () |
Notify a child process of a fork. | |
Public Member Functions inherited from gem5::statistics::Group | |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. | |
virtual | ~Group () |
virtual void | regStats () |
Callback to set stat parameters. | |
virtual void | resetStats () |
Callback to reset stats. | |
virtual void | preDumpStats () |
Callback before stats are dumped. | |
void | addStat (statistics::Info *info) |
Register a stat with this group. | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. | |
void | mergeStatGroup (Group *block) |
Merge the contents (stats & children) of a block to this block. | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
Public Member Functions inherited from gem5::Named | |
Named (const std::string &name_) | |
virtual | ~Named ()=default |
virtual std::string | name () const |
Static Public Attributes | |
static const uint32_t | AuthInvalid = 0 |
Authentication modes. | |
static const uint32_t | AuthNone = 1 |
static const uint32_t | VncOK = 0 |
Error conditions. | |
Protected Member Functions | |
void | listen () |
void | accept () |
void | data () |
void | detach () |
void | sendError (const char *error_msg) |
vnc client Interface | |
bool | read (uint8_t *buf, size_t len) |
Read some data from the client. | |
bool | read1 (uint8_t *buf, size_t len) |
Read len -1 bytes from the client into the buffer provided + 1 assert that we read enough bytes. | |
template<typename T > | |
bool | read (T *val) |
Templated version of the read function above to read simple data to the client. | |
bool | write (const uint8_t *buf, size_t len) |
Write a buffer to the client. | |
template<typename T > | |
bool | write (T *val) |
Templated version of the write function above to write simple data to the client. | |
bool | write (const char *str) |
Send a string to the client. | |
void | checkProtocolVersion () |
Check the client's protocol verion for compatibility and send the security types we support. | |
void | checkSecurity () |
Check that the security exchange was successful. | |
void | sendServerInit () |
Send client our idea about what the frame buffer looks like. | |
void | sendError (std::string error_msg) |
Send an error message to the client when something goes wrong. | |
void | sendFrameBufferUpdate () |
Send a updated frame buffer to the client. | |
void | setPixelFormat () |
Receive pixel foramt message from client and process it. | |
void | setEncodings () |
Receive encodings message from client and process it. | |
void | requestFbUpdate () |
Receive message from client asking for updated frame buffer. | |
void | recvKeyboardInput () |
Receive message from client providing new keyboard input. | |
void | recvPointerInput () |
Recv message from client providing new mouse movement or button click. | |
void | recvCutText () |
Receive message from client that there is text in it's paste buffer. | |
void | sendFrameBufferResized () |
Tell the client that the frame buffer resized. | |
Protected Member Functions inherited from gem5::VncInput | |
void | captureFrameBuffer () |
Captures the current frame buffer to a file. | |
Protected Member Functions inherited from gem5::Drainable | |
Drainable () | |
virtual | ~Drainable () |
virtual void | drainResume () |
Resume execution after a successful drain. | |
void | signalDrainDone () const |
Signal that an object is drained. | |
Protected Attributes | |
ListenEvent * | listenEvent |
DataEvent * | dataEvent |
int | number |
int | dataFd |
ListenSocketPtr | listener |
ConnectionState | curState |
The rfb prototol state the connection is in. | |
bool | sendUpdate |
An update needs to be sent to the client. | |
PixelFormat | pixelFormat |
The one and only pixel format we support. | |
bool | supportsRawEnc |
If the vnc client supports receiving raw data. | |
bool | supportsResizeEnc |
If the vnc client supports the desktop resize command. | |
Protected Attributes inherited from gem5::VncInput | |
VncKeyboard * | keyboard |
The device to notify when we get key events. | |
VncMouse * | mouse |
The device to notify when we get mouse events. | |
const FrameBuffer * | fb |
pointer to the actual data that is stored in the frame buffer device | |
uint16_t | _videoWidth |
the width of the frame buffer we are sending to the client | |
uint16_t | _videoHeight |
the height of the frame buffer we are sending to the client | |
bool | captureEnabled |
Flag indicating whether to capture snapshots of frame buffer or not. | |
int | captureCurrentFrame |
Current frame number being captured to a file. | |
OutputDirectory * | captureOutputDirectory |
Directory to store captured frames to. | |
uint64_t | captureLastHash |
Computed hash of the last captured frame. | |
std::unique_ptr< ImgWriter > | captureImage |
Cached ImgWriter object for writing out frame buffers to file. | |
enums::ImageFormat | imgFormat |
image format | |
Protected Attributes inherited from gem5::SimObject | |
const SimObjectParams & | _params |
Cached copy of the object parameters. | |
Protected Attributes inherited from gem5::EventManager | |
EventQueue * | eventq |
A pointer to this object's event queue. | |
Static Protected Attributes | |
static const PixelConverter | pixelConverter |
Friends | |
class | ListenEvent |
class | DataEvent |
Additional Inherited Members | |
Static Public Member Functions inherited from gem5::SimObject | |
static void | serializeAll (const std::string &cpt_dir) |
Create a checkpoint by serializing all SimObjects in the system. | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. | |
static void | setSimObjectResolver (SimObjectResolver *resolver) |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. | |
static SimObjectResolver * | getSimObjectResolver () |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. | |
Static Public Member Functions inherited from gem5::Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. | |
static void | generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream) |
Generate a checkpoint file so that the serialization can be routed to it. | |
Definition at line 62 of file vncserver.hh.
typedef VncServerParams gem5::VncServer::Params |
Definition at line 191 of file vncserver.hh.
gem5::VncServer::VncServer | ( | const Params & | p | ) |
Definition at line 118 of file vncserver.cc.
References gem5::VncInput::PixelFormat::bigendian, gem5::VncInput::PixelFormat::bluemax, gem5::VncInput::PixelFormat::blueshift, gem5::VncInput::PixelFormat::bpp, gem5::PixelConverter::byte_order, gem5::PixelConverter::ch_b, gem5::PixelConverter::ch_g, gem5::PixelConverter::ch_r, curState, gem5::PixelConverter::depth, gem5::VncInput::PixelFormat::depth, DPRINTF, gem5::VncInput::PixelFormat::greenmax, gem5::VncInput::PixelFormat::greenshift, gem5::PixelConverter::length, listen(), gem5::PixelConverter::Channel::mask, gem5::PixelConverter::Channel::offset, gem5::MipsISA::p, pixelConverter, pixelFormat, gem5::VncInput::PixelFormat::redmax, gem5::VncInput::PixelFormat::redshift, gem5::VncInput::PixelFormat::truecolor, and WaitForProtocolVersion.
gem5::VncServer::~VncServer | ( | ) |
Definition at line 145 of file vncserver.cc.
References dataEvent, dataFd, and listenEvent.
|
protected |
Definition at line 175 of file vncserver.cc.
References gem5::atomic_write(), DataEvent, dataEvent, dataFd, gem5::EventManager::eventQueue(), gem5::ArmISA::fd, inform, listener, gem5::Named::name(), panic, gem5::pollQueue, gem5::PollQueue::schedule(), vncVersion(), warn, and write().
|
protected |
Check the client's protocol verion for compatibility and send the security types we support.
Definition at line 369 of file vncserver.cc.
References AuthInvalid, AuthNone, curState, detach(), DPRINTF, gem5::ArmISA::err, gem5::htobe(), gem5::ArmISA::len, read(), sendError(), WaitForProtocolVersion, WaitForSecurityResponse, warn, and write().
Referenced by data().
|
protected |
Check that the security exchange was successful.
Definition at line 423 of file vncserver.cc.
References AuthNone, curState, DPRINTF, gem5::htobe(), read(), sendError(), VncOK, WaitForClientInit, WaitForSecurityResponse, warn, and write().
Referenced by data().
|
protected |
Definition at line 212 of file vncserver.cc.
References checkProtocolVersion(), checkSecurity(), gem5::VncInput::ClientCutText, gem5::VncInput::ClientFrameBufferUpdate, gem5::VncInput::ClientKeyEvent, gem5::VncInput::ClientPointerEvent, gem5::VncInput::ClientSetEncodings, gem5::VncInput::ClientSetPixelFormat, curState, detach(), DPRINTF, NormalPhase, panic, read(), recvCutText(), recvKeyboardInput(), recvPointerInput(), requestFbUpdate(), sendServerInit(), setEncodings(), setPixelFormat(), WaitForClientInit, WaitForProtocolVersion, WaitForSecurityResponse, and warn.
|
protected |
Definition at line 340 of file vncserver.cc.
References curState, dataEvent, dataFd, DPRINTF, inform, number, gem5::pollQueue, gem5::PollEvent::queued(), gem5::PollQueue::remove(), and WaitForProtocolVersion.
Referenced by checkProtocolVersion(), data(), frameBufferResized(), read(), setEncodings(), setPixelFormat(), and write().
|
overridevirtual |
Reimplemented from gem5::VncInput.
Definition at line 716 of file vncserver.cc.
References curState, dataFd, detach(), NormalPhase, sendFrameBufferResized(), and supportsResizeEnc.
|
protected |
Definition at line 160 of file vncserver.cc.
References gem5::ListenSocket::allDisabled(), listener, ListenEvent, listenEvent, gem5::pollQueue, gem5::PollQueue::schedule(), and warn_once.
Referenced by VncServer().
|
protected |
Templated version of the read function above to read simple data to the client.
val | data to recv from the client |
Definition at line 302 of file vncserver.cc.
References read(), and gem5::X86ISA::val.
|
protected |
Read some data from the client.
buf | the data to read |
len | the amount of data to read |
Definition at line 273 of file vncserver.cc.
References dataFd, detach(), DPRINTF, gem5::ArmISA::len, panic, and read().
Referenced by checkProtocolVersion(), checkSecurity(), data(), read(), read(), read1(), recvCutText(), and setEncodings().
|
protected |
Read len -1 bytes from the client into the buffer provided + 1 assert that we read enough bytes.
This function exists to handle reading all of the protocol structs above when we've already read the first byte which describes which one we're reading
buf | the address of the buffer to add one to and read data into |
len | the amount of data + 1 to read |
Definition at line 294 of file vncserver.cc.
References gem5::ArmISA::len, and read().
Referenced by recvCutText(), recvKeyboardInput(), recvPointerInput(), requestFbUpdate(), setEncodings(), and setPixelFormat().
|
protected |
Receive message from client that there is text in it's paste buffer.
This is a no-op at the moment, but perhaps we would want to be able to paste it at some point.
Definition at line 597 of file vncserver.cc.
References gem5::betoh(), DPRINTF, gem5::VncInput::ClientCutTextMessage::length, read(), and read1().
Referenced by data().
|
protected |
Receive message from client providing new keyboard input.
Definition at line 563 of file vncserver.cc.
References gem5::betoh(), gem5::VncInput::KeyEventMessage::down_flag, DPRINTF, gem5::VncInput::KeyEventMessage::key, gem5::VncInput::keyboard, gem5::VncKeyboard::keyPress(), and read1().
Referenced by data().
|
protected |
Recv message from client providing new mouse movement or button click.
Definition at line 579 of file vncserver.cc.
References gem5::betoh(), gem5::VncInput::PointerEventMessage::button_mask, DPRINTF, gem5::VncInput::mouse, gem5::VncMouse::mouseAt(), read1(), gem5::VncInput::PointerEventMessage::x, and gem5::VncInput::PointerEventMessage::y.
Referenced by data().
|
protected |
Receive message from client asking for updated frame buffer.
Definition at line 543 of file vncserver.cc.
References gem5::betoh(), DPRINTF, gem5::VncInput::FrameBufferUpdateReq::height, read1(), sendFrameBufferUpdate(), gem5::VncInput::FrameBufferUpdateReq::width, gem5::VncInput::FrameBufferUpdateReq::x, and gem5::VncInput::FrameBufferUpdateReq::y.
Referenced by data().
|
protected |
vnc client Interface
Send an error message to the client
error_msg | text to send describing the error |
Definition at line 360 of file vncserver.cc.
References gem5::ArmISA::len, and write().
Referenced by checkProtocolVersion(), and checkSecurity().
|
protected |
Send an error message to the client when something goes wrong.
error_msg | error to send |
|
protected |
Tell the client that the frame buffer resized.
This happens when the simulated system changes video modes (E.g. X11 starts).
Definition at line 674 of file vncserver.cc.
References curState, dataFd, DPRINTF, gem5::VncServer::FrameBufferRect::encoding, EncodingDesktopSize, gem5::VncInput::fb, gem5::VncServer::FrameBufferRect::height, gem5::htobe(), NormalPhase, gem5::VncServer::FrameBufferUpdate::num_rects, ServerFrameBufferUpdate, gem5::VncServer::FrameBufferUpdate::type, gem5::VncInput::videoHeight(), gem5::VncInput::videoWidth(), gem5::VncServer::FrameBufferRect::width, write(), gem5::VncServer::FrameBufferRect::x, and gem5::VncServer::FrameBufferRect::y.
Referenced by frameBufferResized().
|
protected |
Send a updated frame buffer to the client.
Definition at line 621 of file vncserver.cc.
References curState, dataFd, DPRINTF, gem5::VncServer::FrameBufferRect::encoding, EncodingRaw, gem5::VncInput::fb, gem5::PixelConverter::fromPixel(), gem5::FrameBuffer::height(), gem5::VncServer::FrameBufferRect::height, gem5::htobe(), gem5::PixelConverter::length, NormalPhase, gem5::VncServer::FrameBufferUpdate::num_rects, gem5::FrameBuffer::pixel(), pixelConverter, sendUpdate, ServerFrameBufferUpdate, gem5::VncServer::FrameBufferUpdate::type, gem5::VncInput::videoHeight(), gem5::VncInput::videoWidth(), gem5::FrameBuffer::width(), gem5::VncServer::FrameBufferRect::width, write(), gem5::RiscvISA::x, gem5::VncServer::FrameBufferRect::x, and gem5::VncServer::FrameBufferRect::y.
Referenced by requestFbUpdate(), and setDirty().
|
protected |
Send client our idea about what the frame buffer looks like.
Definition at line 445 of file vncserver.cc.
References gem5::VncInput::PixelFormat::bigendian, gem5::VncInput::PixelFormat::bluemax, gem5::VncInput::PixelFormat::blueshift, gem5::VncInput::PixelFormat::bpp, curState, gem5::VncInput::PixelFormat::depth, DPRINTF, gem5::VncServer::ServerInitMsg::fbHeight, gem5::VncServer::ServerInitMsg::fbWidth, gem5::VncInput::PixelFormat::greenmax, gem5::VncInput::PixelFormat::greenshift, gem5::htobe(), gem5::VncServer::ServerInitMsg::name, gem5::VncServer::ServerInitMsg::namelen, NormalPhase, gem5::VncInput::PixelFormat::padding, pixelFormat, gem5::VncServer::ServerInitMsg::px, gem5::VncInput::PixelFormat::redmax, gem5::VncInput::PixelFormat::redshift, gem5::VncInput::PixelFormat::truecolor, gem5::VncInput::videoHeight(), gem5::VncInput::videoWidth(), and write().
Referenced by data().
|
overridevirtual |
The frame buffer uses this call to notify the vnc server that the frame buffer has been updated and a new image needs to be sent to the client.
Reimplemented from gem5::VncInput.
Definition at line 707 of file vncserver.cc.
References sendFrameBufferUpdate(), sendUpdate, and gem5::VncInput::setDirty().
|
protected |
Receive encodings message from client and process it.
Definition at line 507 of file vncserver.cc.
References gem5::betoh(), detach(), DPRINTF, gem5::ArmISA::encoding, EncodingDesktopSize, EncodingRaw, gem5::VncInput::PixelEncodingsMessage::num_encodings, read(), read1(), supportsRawEnc, supportsResizeEnc, warn, and gem5::RiscvISA::x.
Referenced by data().
|
protected |
Receive pixel foramt message from client and process it.
Definition at line 475 of file vncserver.cc.
References gem5::betoh(), gem5::VncInput::PixelFormat::bigendian, gem5::VncInput::PixelFormat::bluemax, gem5::VncInput::PixelFormat::blueshift, gem5::VncInput::PixelFormat::bpp, gem5::VncInput::PixelFormat::depth, detach(), DPRINTF, gem5::VncInput::PixelFormat::greenmax, gem5::VncInput::PixelFormat::greenshift, pixelFormat, gem5::VncInput::PixelFormatMessage::px, read1(), gem5::VncInput::PixelFormat::redmax, gem5::VncInput::PixelFormat::redshift, gem5::VncInput::PixelFormat::truecolor, and warn.
Referenced by data().
|
protected |
Send a string to the client.
str | string to transmit |
Definition at line 333 of file vncserver.cc.
References write().
|
protected |
Write a buffer to the client.
buf | buffer to send |
len | length of the buffer |
Definition at line 309 of file vncserver.cc.
References gem5::atomic_write(), dataFd, detach(), DPRINTF, gem5::ArmISA::len, and panic.
Referenced by accept(), checkProtocolVersion(), checkSecurity(), sendError(), sendFrameBufferResized(), sendFrameBufferUpdate(), sendServerInit(), write(), and write().
|
protected |
Templated version of the write function above to write simple data to the client.
val | data to send to the client |
Definition at line 327 of file vncserver.cc.
References gem5::X86ISA::val, and write().
|
friend |
Definition at line 177 of file vncserver.hh.
Referenced by accept().
|
friend |
Definition at line 163 of file vncserver.hh.
Referenced by listen().
|
protected |
The rfb prototol state the connection is in.
Definition at line 199 of file vncserver.hh.
Referenced by checkProtocolVersion(), checkSecurity(), data(), detach(), frameBufferResized(), sendFrameBufferResized(), sendFrameBufferUpdate(), sendServerInit(), and VncServer().
|
protected |
Definition at line 178 of file vncserver.hh.
Referenced by accept(), detach(), and ~VncServer().
|
protected |
Definition at line 181 of file vncserver.hh.
Referenced by accept(), detach(), frameBufferResized(), read(), sendFrameBufferResized(), sendFrameBufferUpdate(), write(), and ~VncServer().
|
protected |
Definition at line 183 of file vncserver.hh.
|
protected |
Definition at line 164 of file vncserver.hh.
Referenced by listen(), and ~VncServer().
|
protected |
Definition at line 180 of file vncserver.hh.
Referenced by detach().
|
staticprotected |
Definition at line 315 of file vncserver.hh.
Referenced by sendFrameBufferUpdate(), and VncServer().
|
protected |
The one and only pixel format we support.
Definition at line 206 of file vncserver.hh.
Referenced by sendServerInit(), setPixelFormat(), and VncServer().
|
protected |
An update needs to be sent to the client.
Without doing this the client will constantly request data that is pointless
Definition at line 203 of file vncserver.hh.
Referenced by sendFrameBufferUpdate(), and setDirty().
|
protected |
If the vnc client supports receiving raw data.
It always should
Definition at line 209 of file vncserver.hh.
Referenced by setEncodings().
|
protected |
If the vnc client supports the desktop resize command.
Definition at line 212 of file vncserver.hh.
Referenced by frameBufferResized(), and setEncodings().